我有一个 C# 项目。我想根据配置构建 exe 或 MSI。
MSI 定义为
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">MSI</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<ProjectGuid>{DCB76E90-6364-4DFB-B568-3680EE4F9C80}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>Project1</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MSI|x86' ">
<OutputPath>bin\MSI2\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="MyWxs.wxs" />
</ItemGroup>
问题是当我尝试同时拥有两者时
<Import Project="$(WixTargetsPath)" />
和
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
错误
A problem occurred while trying to set the "TargetType" parameter for the IDE's in-process compiler.
Invalid target type "package" for /target: must specify 'exe', 'winexe', 'library', or 'module'.
我该怎么办?