We use msbuild to build our .NET application on a server dedicated to builds. We are migrating to new hardware which has 64 bit Windows 2003. I can build the application using the 64 bit version of msbuild found in Framework64 or I can build it using the 32 bit verison found in Framework. Is there any advantage to building with the 64 bit version of msbuild?
问题:
回答1:
Not particularly no. The only real advantage is that the 64 bit version of msbuild will be able to take advantage of more address space. That's really about it.
回答2:
No but there might be some disadvantages... if your application uses any 3rd party drivers, make sure that they are also 64-bit compliant. We ran into an issue where we converted an older application to .net and kept the default 'Platform Target: Any CPU' setting on Build->General and while the application worked very well on its development machine as soon as we moved it over to a 64bit server it died. Took us a while to trace it back to a 3rd party ODBC driver which we require to interface with an external data source. The application DID work on the 64bit platform, we just needed to specify x86 for the CPU which sort of defeats the purpose.
回答3:
If MSBuild is running tests that have dependencies on x64 libraries; or if your build process otherwise requires loading native x64 libraries, you need to use msbuild x64.
We had to use msbuild x64 because we were running xunit tests, and some of our libraries had to be x64 because they call native x64 libs.
In theory we could have used a different test runner to launch an x64 process to run tests; but using msbuild x64 is easiest.
As noted in https://xunit.github.io/docs/running-tests-in-msbuild.html :
You can use an
<exec>
task in MSBuild to run the console runner. You may choose to use the console runner if you need more control over running tests in 32- vs. 64-bit environments. When using the MSBuild runner, you are restricted to the bitness choice of the MSBuild executable that you used to run your build.
Note that this has nothing to do with compiling - we could have built our x64-only project using msbuild x86.
回答4:
if you are going to do asp.net one big advantage is IIS can access more memory, this gives you more scalability.
The dot not rocks guys did a show on this
http://www.dotnetrocks.com/default.aspx?showNum=341
there is a lot of really good info on it.
回答5:
The Biztalk interop assemblies are one fine example of assemblies that are NOT 64-bits capable. So test and test again when/after making such a move.