I have the main application with a sitemap file. And all the string resources are in two separate projects like a english project and spanish project. I'm using these two satellite assemblies in the main project. For ex: the main application name is "myapp.dll"
and the two satellite assemblies are "myapp.en-US.resources.dll" and "myapp.es-MX.resources.dll".
Now i want to add localization support to my sitemap. And i understand that we have explicit resource key mechanism to point to a class(resx file) in app_globalresources folder for english and spanish.
The problem here is when we compile the solution, the main app is also generating "myapp.en-US.resources.dll" and "myapp.es-MX.resources.dll" which are copied to the bin folder. So now i can only use the satellite assemblies or the dlls for sitemap. I
cannot use both.
Is there any solution for this? Can i have my sitemap take the resources from the satellite assemblies? Why is it only taking the resources from app_globalresources?
I am not sure why are you creating separate projects for your satellite assemblies. ASP.NET creates the same dynamically (using the resource files) out of which the appropriate one is picked up based on the current thread's culture info.
Thanks for the response. But it is the recommended model in .net right? Also, if we use app_globalresources whenever you change a value in any resource file, i agree that the corresponding dlls are created automatically but the entire application will
restart which we dont want to happen. If we maintain them in a separate project, we can recompile the dll and update the dll on the fly. The application will pick up the new dll and continue to work. Thats a huge advantage. I read many articles that say
this as a recommended approach and practically i felt the same.
But i didnt understand how could MS overlooked this potential problem. It seems to me that we cannot localize sitemap with satellite assemblies. Please let me know if there is any workaround.
Sorry for my late response. I just confirmed that even if you replace the DLL, it will lead to an application restart. Any changes in the /bin folder will make the app restart. So is there any other use for using a separate project for resources? Or are
you seeing a different behavior (like app is not geting restarted by changing the dll's on fly)?
We observed that the Application is not restarting if we change the satellite assembly in runtime. Thats a huge advantage right? That is the main reason we chose satellite assemblies over app_globalresources.
I need to clarify this myself. Actually I asked the same to Scott in one of his blogs and I need to verify the answer myself too (just give me a few days). Meanwhile, you can have a look at my post to Scott's blog at:
I saw your comment. Its correct but not complete. We already know that using satellite assemblies is not restarting the application and using app_globalresources is restarting the app.
But the problem here is, with the sitemap feature and satellite assemblies. As far as i know, sitemap file is expecting the resource file in app_globalresources and if we place a resx file there, the compiler will create another set of resource dlls thus
overwriting my satellite assemblies. The names of the dlls are the same.
I posted a comment to Scott explaining my problem. Please visit the blog.
None
0 Points
9 Posts
Problem using sitemap localization with satellite assemblies
Sep 08, 2006 07:25 PM|gopalav|LINK
Hi!
I have the main application with a sitemap file. And all the string resources are in two separate projects like a english project and spanish project. I'm using these two satellite assemblies in the main project. For ex: the main application name is "myapp.dll" and the two satellite assemblies are "myapp.en-US.resources.dll" and "myapp.es-MX.resources.dll".
Now i want to add localization support to my sitemap. And i understand that we have explicit resource key mechanism to point to a class(resx file) in app_globalresources folder for english and spanish.
The problem here is when we compile the solution, the main app is also generating "myapp.en-US.resources.dll" and "myapp.es-MX.resources.dll" which are copied to the bin folder. So now i can only use the satellite assemblies or the dlls for sitemap. I cannot use both.
Is there any solution for this? Can i have my sitemap take the resources from the satellite assemblies? Why is it only taking the resources from app_globalresources?
Thanks
Venugopal
Star
9003 Points
3145 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 09, 2006 01:05 AM|vivek_iit|LINK
Hi Venu,
I am not sure why are you creating separate projects for your satellite assemblies. ASP.NET creates the same dynamically (using the resource files) out of which the appropriate one is picked up based on the current thread's culture info.
See this article for details:
http://www.codeproject.com/useritems/localization.asp
Hope this helps,
Vivek
Communifire: Social Networking and Business Collaboration Platform
None
0 Points
9 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 11, 2006 12:15 PM|gopalav|LINK
Hi Vivek,
Thanks for the response. But it is the recommended model in .net right? Also, if we use app_globalresources whenever you change a value in any resource file, i agree that the corresponding dlls are created automatically but the entire application will restart which we dont want to happen. If we maintain them in a separate project, we can recompile the dll and update the dll on the fly. The application will pick up the new dll and continue to work. Thats a huge advantage. I read many articles that say this as a recommended approach and practically i felt the same.
But i didnt understand how could MS overlooked this potential problem. It seems to me that we cannot localize sitemap with satellite assemblies. Please let me know if there is any workaround.
Thanks
Star
9003 Points
3145 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 26, 2006 06:28 AM|vivek_iit|LINK
Hi Gopalav,
Sorry for my late response. I just confirmed that even if you replace the DLL, it will lead to an application restart. Any changes in the /bin folder will make the app restart. So is there any other use for using a separate project for resources? Or are you seeing a different behavior (like app is not geting restarted by changing the dll's on fly)?
Vivek
Communifire: Social Networking and Business Collaboration Platform
None
0 Points
9 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 28, 2006 11:59 AM|gopalav|LINK
Hi Vivek,
We observed that the Application is not restarting if we change the satellite assembly in runtime. Thats a huge advantage right? That is the main reason we chose satellite assemblies over app_globalresources.
Thanks
Star
9003 Points
3145 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 28, 2006 02:44 PM|vivek_iit|LINK
Hello,
I need to clarify this myself. Actually I asked the same to Scott in one of his blogs and I need to verify the answer myself too (just give me a few days). Meanwhile, you can have a look at my post to Scott's blog at:
http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx
See the last comments and let me know if I asked the right thing.
Thanks,
Vivek
Communifire: Social Networking and Business Collaboration Platform
None
0 Points
9 Posts
Re: Problem using sitemap localization with satellite assemblies
Sep 28, 2006 03:13 PM|gopalav|LINK
Hi!
I saw your comment. Its correct but not complete. We already know that using satellite assemblies is not restarting the application and using app_globalresources is restarting the app.
But the problem here is, with the sitemap feature and satellite assemblies. As far as i know, sitemap file is expecting the resource file in app_globalresources and if we place a resx file there, the compiler will create another set of resource dlls thus overwriting my satellite assemblies. The names of the dlls are the same.
I posted a comment to Scott explaining my problem. Please visit the blog.
Thanks a lot for your help in this regard.
Star
9003 Points
3145 Posts
Re: Problem using sitemap localization with satellite assemblies
Oct 15, 2006 02:16 PM|vivek_iit|LINK
Hi,
Did you get any reply to your email to Scott?
Would like to know what method you used finally :-)
Thanks,
Vivek
Communifire: Social Networking and Business Collaboration Platform