GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/2/2010 11:40:37 AM
Gravatar
Total Posts 2

GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

I was following the tutorial videos on the developer forum when I ran into a problem on number 14.  I am using VWD2010 Express and trying to use the GuestBookResources.resx to assign a label to the submit button.  I have a warning of "Cannot find custom tool 'GlobalResourceProxyGenerator' on this system", which I think is leading to the error of "acme.Web.UI.App_GlobalResources.GuestBookResources' does not contain a definition for 'SubmitButton'. 

This is in GuestBook.ascx.cs under PopulateLabels

private void PopulateLabels()
{
TitleControl.EditText = "Edit";
btnSubmit.Text = GuestBookResources.SubmitButton;
}

8/3/2010 7:47:10 AM
Gravatar
Total Posts 18439

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

Hi,

Make sure your post build event is copying the files from the acme project App_GlobalResources folder up to the Web/App_GlobalResources folder.

Also, when you created the App_GlobalResources folder in the acme project it should not be created like a normal folder, instead you right click the project and choose Add > Add ASP.NET Folder > App_GlobalResources

If you did not create the folder that way it could lead to this problem.

Hope it helps,

Joe

8/6/2010 10:08:27 AM
Gravatar
Total Posts 2

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

I experienced this issue too. I think, maybe, that support of GlobalProxyResourceGenerator is not available in Visual Web Developer(VWD) 2010 Express - though I have not been able to find that documented anywhere on the Microsoft site - so possibly it is a bug?  I downloaded an evaluation of the full blown Visual Studio 2010 and the project developed under VWD 2010 Express then compiled fine with no changes under Visual Studio. In ASP.NET folders there is an option "Run" "Customtool" which shows up in VWD 2010 Express with the tool name set to GlobalResourceProxyGenerator but when I used the "run" option to generate the designer file I got a "not found" message consistent with the other error message showing up. I would report to Microosoft but could n't find an easy way to do that as I think, if I am correct, they should not generate the Customtool setting in VWD 2010 Express when it does n't exist!

Looking to use MojoPortal for a non-profit I volunteer for and so far I am impressed - though inability to use VWD 2010 Express maybe an issue - good job Joe! Thanks, John.

8/6/2010 4:33:24 PM
Gravatar
Total Posts 125

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

I met a similar problem before in visual web developer express. I have to switch to the visual studio professional to make it work.

8/7/2010 9:39:19 PM
Gravatar
Total Posts 2

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

I'm fairly certain this is a limitation of VWD2010 Express, but could not find any documentation on the net anywhere about this issue.  I wanted to at least document the problem here so others can find this resource when searching.  This incompatibility with VWD2010 Express along with C# not being my native language of choice has led me away from mojoportal.  This is unfortunate because this is a great project.  Thanks

8/8/2010 7:00:18 AM
Gravatar
Total Posts 18439

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

I am able to reproduce the problem and found a workaround that seems to solve it.

After you create your .resx file, right click it and choose properties, then change Custom Tool from GlobalResourcesProxyGenerator to PublicResXFileCodeGenerator

then you can reference it with

using acme.Web.UI.App_GlobalResources;

and code like this now works:

btnSubmit.Text = GuestBookResources.SubmitButton;

Hope it helps,

Joe

11/17/2010 6:01:03 AM
Gravatar
Total Posts 13

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

Tambien hago uso de Visual Web Developer 2010 y aunque he seguido tu consejo Joe de cambiar la herramienta personalizada GlobalResourcesProxyGenerator por PublicResXFileCodeGenerator, compila bien pero al ejecutar muestra el siguiente error:

No se encontraron recursos adecuados para la referencia cultural especificada o para la referencia cultural neutra. Compruebe si "WebAgenda.UI.App_GlobalResources.WebAgendaResources.resources" se ha incrustado o vinculado  correctamente en el ensamblado "WebAgenda.UI" durante el tiempo de compilación o que todos los ensamblados satélite requeridos pueden cargarse y están completamente firmados.


Seguimiento de la pila:

[MissingManifestResourceException: No se encontraron recursos adecuados para la referencia cultural especificada o para la referencia cultural neutra. Compruebe si "WebAgenda.UI.App_GlobalResources.WebAgendaResources.resources" se ha incrustado o vinculado  correctamente en el ensamblado "WebAgenda.UI" durante el tiempo de compilación o que todos los ensamblados satélite requeridos pueden cargarse y están completamente firmados.]
   System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName) +408
   System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) +9618294
   System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) +560
   System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +48
   System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +297
   WebAgenda.UI.App_GlobalResources.WebAgendaResources.get_SubmitButton() +57
   WebAgenda.UI.AgendaWebModuleModule.PopulateLabels() +64
   WebAgenda.UI.AgendaWebModuleModule.Page_Load(Object sender, EventArgs e) +45
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Saludos,

Hector.

1/25/2011 3:48:25 PM
Gravatar
Total Posts 52

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

First I'll answer in Spanish (for hextor19) and then translate it into English.

En español:

El problema del cambio de herramienta de servicio está en como genera el fichero <fichero de recursos>.Designer.cs la nueva herramienta, lo que hice para solucionarlo es seleccionar el <fichero de recursos>.resx con el botón derecho y seleccionar propiedades (Alt+Enter). En el cuadro de diálogo de las propiedades tengo los siguientes valores:

  • Acción de compilación: Contenido
  • Copiar en el directorio de resultados: No copiar
  • Espacio de nombres de la herramienta personalizada: Resources
  • Herramienta personalizada: ResXFileCodeGenerator

He observado que la herramienta PublicResXFileCodeGenerator también funciona y necesita la misma corrección, pero la diferencia es que te declara las referencias como públicas, y no como internas. Esto también lo puedes modificar en la parte superior de la pantalla de edición del fichero .resx y ponerlo como internal, pero no veo la necesidad de tener que cambiarlo cada vez.

Con esta configuración el generador crea un fichero correcto excepto por una línea, la 42. Hay que tener en cuenta que este fichero se genera cada vez que tocas el fichero .resx (o si cambias las propiedades del mismo). Con lo cual hay que acordarse de corregir el error cada vez que creas recursos nuevos.
La corrección a realizar en la linea 42, que debe decir algo como:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("<espacio de nombres de recursos>", typeof(<clase>).Assembly);

es cambiarla por:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.<clase>", global::System.Reflection.Assembly.Load("App_GlobalResources"));

En el caso del ejemplo, el espacio de nombres de recursos es "acme.Web.UI.App_GlobalResources.GuestBookResources" y la clase es "GuestBookResources". Es decir la línea quedaría habría que cambiar:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("acme.Web.UI.App_GlobalResources.GuestBookResources", typeof(GuestBookResources).Assembly);

por:

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

Compilas y debería funcionar. Cuando crees ficheros de traducción deberán llevar el mismo nombre pero con los caracteres de la cultura antes de la extensión .resx (por ejemplo Guestbook.es.resx para español). Estos ficheros no deben generar código, es decir, los parámetros de la herramienta personalizada deben estar vacíos.

In English:

The problem of changing service tool is in how the new tool generates the file <resocurcefile>.Designer.cs, what I did to fix it is to select the <resourcefile>.resx, right click on it and select properties (Alt + Enter). In the dialog box I have the set the following properties values (translations may not be exact):

  • Build action: Content
  • Copy to Output Directory: Do not copy
  • Custom Tool: ResXFileCodeGenerator
  • Custom Tool Namespace: Resources

I have noticed that the tool also works with PublicResXFileCodeGenerator, and needs the same fix too, but the difference is that you declares the references as public, and not as internal. This can also be modified in the top of the file editing screen .resx and get as internal, but I see no need to change it every time.
With this configuration, the generator creates a correct file except for one line, the number 42. Keep in mind that this file is generated every time you change the file .resx (or if you change its properties). So we must remember to correct the error every time you create new resources.
The correction to make to the line 42, that must say something like:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("<namespace>", typeof(<class>).Assembly);

is changing it to:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.<class>", global::System.Reflection.Assembly.Load("App_GlobalResources"));

In the example the name space is "acme.Web.UI.App_GlobalResources.GuestBookResources" and the class is "GuestBookResources". Si the line should look like:

  • global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("acme.Web.UI.App_GlobalResources.GuestBookResources", typeof(GuestBookResources).Assembly);

and must be changed to:

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

Compile and it should work. When creating translation files must have the same name but with the culture characters before the extension .resx (eg Guestbook.es.resx for Spanish). These files should not generate code, so the parameters of the custom tool parameters must be empty.

Also refer to http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx for file properties.

 

1/25/2011 3:50:51 PM
Gravatar
Total Posts 52

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

Just one tip, when I make the previous fix I copy the correct line to the .ascx.cs module, so I don't loose it each time I modify the .resx file.

3/17/2011 4:52:05 AM
Gravatar
Total Posts 50

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

Thanks for the solution . 

But it is really not so convenient every time when need to create the resources file.

I had try few times only successfully integrate with the resources file. 

any better solution on this issue ? 

3/17/2011 7:24:22 AM
Gravatar
Total Posts 18439

Re: GlobalResourceProxyGenerator App_GlobalResources Visual Web Developer 2010 Express

you probably qualify to get Visual Studio 2010 Pro free via the Web Site Spark program.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.