You can achieve this by editing your project file by hand. Locate the <AssemblyName>
node and add a conditional attribute to it:
<AssemblyName Condition="'$(Configuration)'=='Debug'">MyApp_Debug.exe</AssemblyName>
<AssemblyName Condition="'$(Configuration)'=='Release'">MyApp_Release.exe</AssemblyName>
You'll have to duplicate it also to add another conditional attribute for the release version.
Whilst it is possible, it may cause problems. There is an AssemblyConfiguration attribute that can be applied to your assembly. In AssemblyInfo.cs
, put:
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
This will add a property to your compiled assembly that will tell you which build configuration your application was built using.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…