Fog Creek Software
Discussion Board




Has anyone figured out the .NET resource manager?

Hi All,

We're just finishing the build of a .NET app. The last thing that we did was go through the localization process. In theory it should work excellently, but there are a number of bugs in its operation that have made the project quite tough. Has anyone else been through this and figured any of the tough spots out?

We started the project in VS 2002, then ugraded it to VS 2003 when it was released. When we first started to go through the localization on our forms it just wouldn't work. When changing a form to a different language the associated resx files weren't created and the language layouts weren't stored or reflected in the designer. I created a new project and brought in all of the forms thinking it may have been because the project originated in 2002.

This worked and everything seemed fine for a while. About a week later, after doing all of our forms but one it just stopped working.Now changing the culture on the form doesn't show in the designer and changes aren't stroed in the associated resx file. I tried creating yet another new project and bringing in the files but this time that didn't work.

Another problem is that any time you make a change to a form it's invariant resx file is completely regenerated, wiping out and custom strings that you may have put in. I didn't realize that until I had gone in and broken out all of our hardcoded strings into the associated culture files, and slowly as changes were made ot forms here and there my messageboxes began going blank when running in English. After determining that VS wipes everything out in the default file when a change is made, I thought about putting my custom strings into an English resx, but the next issue made me decide that wasn't a good idea.

At run time, the resource manager sometimes just doesn't retrieve a setting that is auto generated by the designer and is definately in the resx. In particular, for some reason one of my forms when loaded once in a while and very inconsistantly throws a null reference exception from the line in the auto generated code where it is trying to get the visible property for a label or textbox from the resource file, but only when using English, which are in the invariant default file. It also only does this consistantly on one specific machine, even though we have two that are essentially the same setup (XP PRO sp1, .NET 1.1, etc.).

Whereas ADO.NET has been wonderful for us, the resource manager has been absoluttely terrible. I've looked all through the web, Googled it, Gone through the USenet, MSDN, etc. I've only found others with the same problem, no solutions.

Has anyone here had any experience with this? Have you figured out anything that helps fix it? Most importantly I need to get the design-time switching to work and figure out how to resolve that random null reference exception. What a pain this thing is.

  --Josh

P.S. I also have the VS.NET bug where on some files the Intellisense and auto formatting just stops functioning. THis also seemed to go away for a while after I merged into a new fresh 2003 project, but came back about the same time the design-time resource switching stopped functioning. I've seen all kinds of theories what causes that behavior in the code editor, but I have a sneaky suspicion that it is related to some component I'm using. We're using ActiveReports.net, DotNetBar, Keyoti RapidSpell, and DynaZipNX. Think that may be connected?

JWA
Friday, July 25, 2003

*  Recent Topics

*  Fog Creek Home