Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different Assembly Name for Each Platform Target

I need to generate different assembly names depending on the platform target. For example, I have a console application "bob.exe". Instead of building for AnyCPU, I need to build explicitly for x86 and x64 and thus want "bob32.exe" and "bob64.exe". The Application tab in Visual Studio 2010 project options disables the Platform combobox. Build Events also don't allow options per platform so I can't rename it afterwards very easily.

Update: Manually editing the project file seems to work best, no extra files are part of the build and the pdbs have a matching name.

like image 890
Murray Avatar asked May 17 '10 13:05

Murray


People also ask

How do I change the assembly name in Visual Studio?

This is how you do it: * Right-click the project in Solution Explorer, select Rename, and enter the new name * Right-click the project again and select Properties. Change the "Assembly name" and "Default namespace" on the Application tab.

How do I change from platform target to x64?

To enable x64 as a CPU platform targetClick Configuration Manager. In the Configuration Manager dialog, open the Active solution platform drop-down list box and click <New> …. In the New Solution Platform dialog, select x64 in the Type or select the new platform drop-down list box.


1 Answers

The IDE cannot handle this, but msbuild.exe does. Edit the .csproj file with, say, Notepad. You'll see four PropertyGroups for the settings of x86/x64 and Debug/Release. The first one has an <AssemblyName> element. Copy and paste it into the other 3 groups. And rename their value.

like image 88
Hans Passant Avatar answered Sep 19 '22 07:09

Hans Passant