I have C# application with Visual Studio 2010. I want per-configuration assembly names. That is, I need different assembly names for debug and release configuration. So i edited my csproj as below.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<...>
<...>
</PropertyGroup>
<Choose>
<When Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<PropertyGroup>
<AssemblyName>MyApplication</AssemblyName>
</PropertyGroup>
</When>
<When Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<PropertyGroup>
<AssemblyName>MyApplicationd</AssemblyName>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<...>
<OutputPath>..\..\..\..\utils\debug\Project\x64\</OutputPath>
<...>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<...>
<OutputPath>..\..\..\..\utils\release\Project\x64\</OutputPath>
<...>
</PropertyGroup>
</Project>
The build was success and I got MyApplication.exe for release configuration and MyApplicationd.exe for Debug configuration. But when I, F5/F10 to run the project in Debug mode, I am getting below error.
Visual Studio cannot start debugging because the debug target is missing. Please build the project and retry, or set the OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly.
How can I resolve this? How can I specifying different assembly names based on configuration in project file ?