4
votes

I have a solution that has successfully built in Team City for more than a year. A developer added two projects to the solution and immediately we received the following errors:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(483, 9): The OutputPath property is not set for project 'Compass.Communication.Server.Config.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='DEV' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

Project Compass.Communication.Server.Config\Compass.Communication.Server.Config.csproj failed. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(483, 9): The OutputPath property is not set for project 'Compass.Communication.Server.Processor.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='DEV' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

I have tried most everything I could find about any CPU vs. AnyCPU and lots of other stuff with no success. Here is the project file for the first one:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{5FC19B70-7DB4-4D8A-B33F-748528E5A042}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Compass.Communication.Server.Config</RootNamespace>
    <AssemblyName>Compass.Communication.Server.Config</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>bin\Debug\Compass.Communication.Server.Config.XML</DocumentationFile>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.configuration" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="CommunicationConditionalElement.cs" />
    <Compile Include="CommunicationConditionalSection.cs" />
    <Compile Include="CommunicationConfigurationManager.cs" />
    <Compile Include="CommunicationCriterionElement.cs" />
    <Compile Include="CommunicationCriterionSection.cs" />
    <Compile Include="CommunicationElementExtensions.cs" />
    <Compile Include="CommunicationIntroductionElement.cs" />
    <Compile Include="CommunicationIntroductionSection.cs" />
    <Compile Include="CommunicationSectionElement.cs" />
    <Compile Include="CommunicationSectionSection.cs" />
    <Compile Include="CommunicationTypeElement.cs" />
    <Compile Include="CommunicationTypeSection.cs" />
    <Compile Include="GenericConfigurationElementCollection.cs" />
    <Compile Include="RefElement.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Compass.Communication.Entities\Compass.Communication.Entities.csproj">
      <Project>{25B8C709-0574-496E-BD1D-5F4DF966F258}</Project>
      <Name>Compass.Communication.Entities</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
6

6 Answers

14
votes

I had a similar issue couple of weeks ago and in my case issue was caused because of space between "Any CPU"

You need to make sure that "AnyCPU" does not contain any space wherever you are using in your build definition.

Regards

1
votes

Just resolved similar issue by manually replacing 'AnyCPU" by "x64" inside .csproj file:

<Platform Condition=" '$(Platform)' == '' ">x64</Platform\>
1
votes

you can add the following directly into your project file below

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel> 
</PropertyGroup>
0
votes

This generally occures when you have a project that is not set to build for the active solution configuration but is referenced by a project that is. Check in visual studio and make sure you have added your release and debug solution configurations to the new projects.

0
votes

I've had the same error.

Try to delete the "Platform" environment variable.

Then restart VS, and build your solution...

0
votes

You can manually insert the OutputPath property into the proj file of the DLL class library. Below is a snippet/example for where it would go.

<propertygroup condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 
</propertygroup> 
<codeanalysisruleset>MinimumRecommendedRules.ruleset</codeanalysisruleset>
<errorreport>prompt</errorreport>
<platformtarget>x64</platformtarget>
<debugtype>full</debugtype>
<defineconstants>DEBUG;TRACE</defineconstants>
<outputpath>bin\x64\Debug\</outputpath>
<debugsymbols>true</debugsymbols>

You may also be able to follow these steps:

  1. Right click solution -> properties
  2. Click “Configuration properties”, then “configuration manager”
  3. Click the platform dropdown list of the Class library, then select “new…”
  4. In the pop up dialog, make sure New platform is x64, and uncheck “Create new solution platforms”, then click OK