Asp – Add satellite assembly in a pre-compiled deployed website

asp.netsatellite-assembly

In order to make use of GetGlobalResourceObject() in Visual Studio 2008 I have to copy a .resx file into the folder App_GlobalResources of Visual Studio. After the application is precompiled, the resource files are being compiled into the corresponding satellite assemblies and deployed under the \bin\ folder by culture names. This all works fine.

However, I'm unable to add new satellite assemblies after the application has been precompiled. What I've done was:

  1. Created a satellite assembly:

    resgen resources.applicationresources.es-ES.resx resources.applicationresources.es-ES.resources
    al /t:lib /culture:es-ES /embed:resources.applicationresources.es-ES.resources /out:App_GlobalResources.resources.dll

  2. Created folder \bin\es-ES\ and deployed the .dll file there.

Unfortunately, the newly added satellite assembly is not being recognized by the GetGlobalResourceObject(), which falls back to the default (English) resource. There seems to be nothing wrong with the resource file because if I copy the same .resx file into App_GlobalResources and then compile the application, everything works just fine.

What am I missing? BTW my project type is website and not web application project.

Best Answer

(From Comment by @ksa)

One thing that can go wrong is an incorrect namespace path in the DLL produced by resgen, you can use ILDASM or Reflector to compare the namespaces in the working DLLs and the generated not working DLLS. You can then change your resgen command line to generate with the correct namespace.

Related Topic