我正在尝试编辑我的项目文件,以便让我拥有一个可以同时构建多个构建配置的项目.我使用批处理方法并使用MSBuild任务(见下文)完成了这项工作.
如果我运行脚本,我会收到此错误:
错误103未为项目"ThisMSBuildProjectFile.csproj"设置OutputPath属性.请检查以确保您为此项目指定了Configuration和Platform的有效组合.Configuration ='Debug'Blatform ='AnyCPU'.
如果我从MSBuild任务添加或省略OutputPath,我会得到这个.如果使用VS2010调试器逐步执行脚本并调用MSBuild任务 - 调试器再次进入文件然后进入OutputPath,那么afaik,它应该选择该值,不是吗?
任何帮助都将非常感激 - 它让我发疯.谢谢,保罗.
这个MSBuildProjectFile.csproj(剩余的东西取出):
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<!-- Only Import normal targets if not building multiple projects -->
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(Configuration)|$(Platform)' != 'AllBuild|AnyCPU' "/>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == '' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>C:\Folder\Etc\Output\$(Configuration)\</OutputPath>
<OutDir>C:\Folder\Etc\Output\$(Configuration)\</OutDir>
<BaseOutputPath>C:\Folder\Etc\Output\$(Configuration)\</BaseOutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!-- Common -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Platform>AnyCPU</Platform>
<!-- Repeated properties from above here (including, of course, OutputPath) -->
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' …Run Code Online (Sandbox Code Playgroud)