.NET Framework Bookmark and Share   
 index > MSBuild > Build process messes localization up
 

Build process messes localization up

Hello everybody

I have solution with a ClassLibrary project in it which contains the Localization class (Localization.cs). There, we added (years ago)resoure files : Localization.resx, Localization.en.resx, Localization.fr.resx, Localization.de.resx.
Additionally there is a website project which references the ClassLib. Further there is a Web Deployment project.

Solution
- ClassLib
-Localization.cs
-Localization.resx
-Localization.fr.resx
-Localization.de.resx
-Localization.en.resx
-WebSite (references ClassLib)
-WebDeployment (builds WebSite)
-
-Other projects (Controls, DAL, etc.)


I'm working with Visula Studio 2005 DotNet 2.0 (I admit, in the web site there is still a reference to the 1.1 MS treeview)

When I build the project then in the deployed folder is a ClassLib.resource.dll (French version) in the bin folder:

bin
/fr/ClassLib.resources.dll -> french, ok
/de/ClassLib.resources.dll -> german, ok
/en/ClassLib.resources.dll -> english, ok
ClassLib.resources.dll -> french, !!!wrong!!! Must there even be a ClassLib.resources.dll?
ClassLib.dll -> contains also resources (language of Localization.cs (default))

When I look a the build output i see these lines ( ClassLib name is Global):

Task "Copy"
Copying file from "C:\Current\Global\bin\Debug\de\Global.resources.dll" to "C:\Current\Web\Bin\Global.resources.dll".
Command:
copy /y "C:\Current\Global\bin\Debug\de\Global.resources.dll" "C:\Current\Web\Bin\Global.resources.dll"

Copying file from "C:\Current\Global\bin\Debug\en\Global.resources.dll" to "C:\Current\Web\Bin\Global.resources.dll".
Command:
copy /y "C:\Current\Global\bin\Debug\en\Global.resources.dll" "C:\Current\Web\Bin\Global.resources.dll"

Copying file from "C:\Current\Global\bin\Debug\fr\Global.resources.dll" to "C:\Current\Web\Bin\Global.resources.dll".
Command:
copy /y "C:\Current\Global\bin\Debug\fr\Global.resources.dll" "C:\Current\Web\Bin\Global.resources.dll"


So, it copies everyresource file over the samedestination"C:\Current\Web\Bin\Global.resources.dll".
Obviously, last wins.

I went so far, installed Visual Studio 2008 SP1 + Updates(on a fresh winxp sp3 virtual machine) and converted the projects -> Same effect.
I added the designer files with vs2008 --> same effect.

The problem is, the website displays the wrong language then. I (of course) have NOTHING changed and its all not my fault....but it worked for years....I suspect my ignorance or a new feature with a service pack.

Should I file a bug or has someone an idea where I should click?
Many Thanks
Ben



zuiopl
Hello,

We have noticed this problem from the previous post in the forum, such as this one:
http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/14e4e7bc-9bb8-4369-8190-87e014aa63f4,
the ownerhas fired a bug on Connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=487101&wa=wsignin1.0

Refer to the reply from our engineer Dan, it's by-design:

Visual Studio's build process does what's called "copy local" for managed projects -- a project reference from A to B causes all the outputs of B, including any documentation file, to get copied to the output directory of A. The reasoning behind this is so that A can find its dependencies if you try to run it -- although that really only requires the dll, not the xml file.

Regarding your following question, because I'm not familiar with Web project, so I'm sorry that I cannot help you at this point. You could go to http://forums.asp.net/for better support.

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Wesley Yao
A bit further above in the log file i see for every entry in web.config an error (see below) :
Are these references in web.config still needed? why does it not find them. They are in GAC_MSIL with same publicKeyToken.....




***********************************************************
Build output:

Dependency "System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
Could not resolve this reference. Could not locate the assembly "System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
For SearchPath "C:\Current\DataAccess\bin\Debug".
Considered "C:\Current\DataAccess\bin\Debug\System.Data.dll", but it didn't exist.
Considered "C:\Current\DataAccess\bin\Debug\System.Data.exe", but it didn't exist.
Required by "C:\Current\DataAccess\bin\Debug\DataAccess.dll".
Required by "C:\Current\Global\bin\Debug\Global.dll".


***********************************************************
Web.Config:

<compilation defaultLanguage="c#" debug="true">
<assemblies>
<!-- AJAX -->
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<!-- AJAX -->
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>




zuiopl
Hello,

We have noticed this problem from the previous post in the forum, such as this one:
http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/14e4e7bc-9bb8-4369-8190-87e014aa63f4,
the ownerhas fired a bug on Connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=487101&wa=wsignin1.0

Refer to the reply from our engineer Dan, it's by-design:

Visual Studio's build process does what's called "copy local" for managed projects -- a project reference from A to B causes all the outputs of B, including any documentation file, to get copied to the output directory of A. The reasoning behind this is so that A can find its dependencies if you try to run it -- although that really only requires the dll, not the xml file.

Regarding your following question, because I'm not familiar with Web project, so I'm sorry that I cannot help you at this point. You could go to http://forums.asp.net/for better support.

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Wesley Yao

You can use google to search for other answers

Custom Search

More Threads

• MSBUILD doesn't seem to be returning an error code.
• MSBuild is not copying the assembly to the output directory.
• Long Question...sorry
• Is there a way to view the magic?
• Deleted configuration in project build menu/Not possible to create configuration with same name as deleted
• Condition for output (verbosity) level
• Setup project build failing
• Environment Variable used in Nant File is not getting set properly
• msbuild Exec Task
• Adding a reference to PE file