我需要根据项目的配置将C#项目构建为WinExe或Library.
我试过这两种方法都没有运气:
1)在一般PropertyGroup中:
<OutputType Condition=" '$(Configuration)' == 'Release' ">WinExe</OutputType>
<OutputType Condition=" '$(Configuration)' == 'Debug' ">Library</OutputType>
2)在条件PropertyGroup中:
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputType>WinExe</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputType>Library</OutputType>
</PropertyGroup>
这两种方法都不起作用,OutputType始终是WinExe.奇怪的是,如果我将WinExe的所有实例更改为库,那么它总是库.这让我觉得它正在成功地阅读它们,但要么是以奇怪的顺序,要么WinExe优先于图书馆.
有任何想法吗?