Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem with missing GlobalResourcesProxyGenerator and solution
ckeavney
#1 Posted : Wednesday, 2 November 2011 11:50:46 AM(UTC)
Rank: Newbie

Joined: 2/11/2011(UTC)
Posts: 1
Location: New York

I want to share a problem I had trying to recompile the GSP source code with VWD 2010 Express. I finally found the solution on another forum (http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=9&thread=6062&pagenumber=1), to which I am indebted because I was struggling with it for two weeks.

If you open the GSP source code in Visual Web Developer 2010 Express and make any changes to the App_GlobalResources\GalleryServerPro.resx file, you will get a warning saying that the custom tool "GlobalResourcesProxyGenerator" is not found. Apparently this tool only comes with the VWD Pro version - a fact which is not well documented - and it's not something you can just download and install, either. If you add any resources to the resx file, they will not be included in the corresponding .designer.cs file (which is supposed to be generated by the custom tool) and so the build will not complete.

You will then find some advice on the Web, suggesting that you change the custom tool setting for that file to "ResXFileCodeGenerator". If you do that, the project will build OK, but you will get a runtime error that says

MissingManifestResourceException:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "GalleryServerPro.Web.App_GlobalResources.GalleryServerPro.resources" was correctly embedded or linked into assembly "GalleryServerPro.Web" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Considering that prompt, you might be tempted to go back and change the Build type for the Galleryserverpro.resx file from "Content" to "Embedded Resource", but this will not lead to success. Apparently this works for some applications, but in GSP, because of the way the resources are used at run time, they can't be embedded or you will get other errors.
Here is the workaround that worked for me, for which I am indebted to "cecheto" at the forum referred to above:

1. Make a backup copy of the App_GlobalResources/GalleryServerPro.designer.cs file as received with the original source code.
2. Set the Custom Tool for the GalleryServerPro.resx file to "ResXFileCodeGenerator", and set the "Custom Tool Namespace" to "Resources". Leave the Build Type set to "Content".
3. Save the GalleryServerPro.resx file. The GalleryServerPro.designer.cs file will be deleted and regenerated.
4. Open the GalleryServerPro.designer.cs file and edit it manually. Make the header of the file match the header of the original file that you made a backup copy of above.
Actually, there are only two lines that need to be changed:

Line 22, which reads:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]

should be changed to:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "10.0.0.0")]

and line 42, which reads:

global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GalleryServerPro.Web.App_GlobalResources.GalleryServerPro", typeof(GalleryServerPro).Assembly);

should be changed to:

global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.GalleryServerPro", global::System.Reflection.Assembly.Load("App_GlobalResources"));

5. Then rebuild the project. Of course, you have to repeat step 4 every time you edit the GalleryServerPro.resx file, so it's not a complete solution.

I'm not a professional developer (which is why I'm using the Express version) and not very familiar with ResourceManager, but this workaround enabled me to make a few changes and rebuild.

Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.