I'm trying to edit my project file to enable me to have a project that builds multiple build configs at once. I've done this using a batching approach and using the MSBuild task (see below).
If I run the script, I get an this error:
Error 103 The OutputPath property is not set for project "ThisMSBuildProjectFile.csproj". Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'.
I get this if I add or omit the OutputPath from the MSBuild task. If used the VS2010 debugger to step through the script and the MSBuild Task is called - the debugger steps into the file again and then steps into OutputPath, so afaik, it should pick that value up, no?
Any help for this would be greatly appreciated - it's driving me crazy. Thanks, Paul.
ThisMSBuildProjectFile.csproj (surplus stuff taken out):
<?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' ">
<!-- Repeated properties from above here (including, of course, OutputPath) -->
</PropertyGroup>
<ItemGroup>
<Projects Include="C:\Folder\Etc\ThisMSBuildProjectFile.csproj" />
</ItemGroup>
<!-- Call this project file again, but with a different configuration - if this was working, this would call multiple build configs -->
<Target Name="Build" Condition="'$(Configuration)|$(Platform)' == 'AllBuild|AnyCPU' ">
<Message Text="hm!"/>
<!-- Tried thiswith and without the OutputPath property - makes no difference. -->
<MSBuild Projects="@(Projects)" Properties="Configuration=Debug;OutputPath=C:\Folder\Etc\Output\" ToolsVersion="4.0" Condition="'$(Configuration)|$(Platform)' == 'AllBuild|AnyCPU' "/>
</Target>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AllBuild|AnyCPU' ">
<!-- Repeated properties from above here (including, of course, OutputPath) -->
</PropertyGroup>
<!-- Project files -->
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Blah\Blah.cs" />
</ItemGroup>