I need to create a C # project like WinExe or Library depending on the configuration of the project.
I tried both of these methods with no luck:
1) In a common PropertyGroup:
<OutputType Condition=" '$(Configuration)' == 'Release' ">WinExe</OutputType>
<OutputType Condition=" '$(Configuration)' == 'Debug' ">Library</OutputType>
2) In the conditional group of properties:
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputType>WinExe</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputType>Library</OutputType>
</PropertyGroup>
None of these methods work, and OutputType is always WinExe. The strange thing is that if I change all instances of WinExe to a library, then it is always a Library. This makes me think that he is reading them successfully, but either in a strange manner, or that WinExe takes precedence over the Library.
Any ideas?
source
share