Release problem

Dec 3, 2012 at 10:51 AM

Hello,

 

I just finished small project with WPFLocalizationExtension. Problem occurs when I switched to release configuration. Every values returned by extension are null, in design mode and in run time. In debug config all work perfect. I don't notice any exceptions or warnings.

I set on debug options in release configuration, but it doesn't change situation. I try to debug WPFLocalizationExtension, but I can't find source of problem. 

I'm using VS 2010 and extension version 2.1.1. Project is compiled for Any CPU platform.

Any help would be appreciated. Thanks.

 

Coordinator
Dec 3, 2012 at 10:55 AM

Hi Senga,

just to make things clear:
1) can you try to clean the solution and rebuild it?
2) check your build configuration: solution -> configuration manager and check if the resource project is build when you build in release mode.
http://msdn.microsoft.com/en-us/library/kwybya3w.aspx 

Cheers,
Bernhard 

Dec 3, 2012 at 12:33 PM

Hi Bernhard,

Of course, I made rebuild, checked date of builded assemblies and satellites... Everything looks good, and application works very well, with the exception of absence of any localized strings.

Cheers,

Christopher

 

Coordinator
Dec 3, 2012 at 12:36 PM

Hi Christopher,

can you provide me an example? It is very hard to analyze this particular problem without access to the problem.

Thanks

Dec 3, 2012 at 1:09 PM

OK, but it will be possible at evening - I hope so ;-)

Dec 4, 2012 at 10:05 AM

Hi Bernard,

I started prepare example for You. I moved solution to another PC (from Vista to XP) and now I have problem in both configurations: debug and release.

Dec 4, 2012 at 11:42 AM

It works!

I made one change. My resx files had names: Resources (in catalog Resources, of course). It was source of problem, I think so. When I renamed them to Resources1 and rebuilded solution, all started to work properly, in design and runtime mode, and in both configurations: debug and release. When I brought back files names extension stop working.

I don't know, why? Maybe, I didn't find enough information about WPFLocalizeExtension and used it incorrect. Anyhow, problem is solved. Thank You, for Your assist.

Cheers,

Christopher

Coordinator
Dec 4, 2012 at 12:08 PM

Ah, of cource, "Resource" is a bad name for resources.

The problem is the following:
1) every project have its "Resource" file as long as you dont remove it explicitly.
2) when we search for the resource file we only look for the end of the paths of the resource files available.

That means we have two paths with the same path ending "Resource.resx" -> first is taken, and that was empty.

I dont know why it was different on the first machine but thats the reason why.

Thanks for pointing it out :)

Cheers 

Dec 4, 2012 at 12:32 PM

Yes, change name of Resource.resx file in catalog Properties, solved problem too. If I understand, It looks like, in Vista with debug mode, it located first file in catalog Resources, and in other cases, in catalog Properties. 

Once again, thanks!

Coordinator
Dec 4, 2012 at 1:06 PM

No problem, you are welcome!