找到你要的答案

Q:OutputPath property is not set for project

Q:outputpath属性未设置为项目

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>

我有一个解决方案,已经成功地建立在团队城市超过一年。开发人员将两个项目添加到解决方案中,并立即收到以下错误:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(483, 9): The outputpath属性未设置为项目 '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属性未设置为项目 '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.

我已经试过所有我能找到的最任何CPU与AnyCPU和其他许多东西没有成功。这是第一个项目文件:

<?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>
answer1: 回答1:

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

几个星期前我也有过类似的问题,我的问题是因为“任何CPU”之间的空间造成的

你需要确保“anycpu”不包含任何空间,无论你是在你的生成定义使用。

当做

answer2: 回答2:

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.

这通常发生在你有一个项目,是不是要建立在“活动解决方案配置”却被一个项目被引用。在Visual Studio中检查并确保已将发布和调试解决方案配置添加到新项目中。

answer3: 回答3:

I've had the same error.

Try to delete the "Platform" environment variable.

Then restart VS, and build your solution...

我也有同样的错误。

尝试删除“平台”环境变量。

然后重新启动VS,并建立你的解决方案…

answer4: 回答4:

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

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

只是解决类似的问题通过手动更换的anycpu”由“x64”内。csproj文件:

<Platform Condition=" '$(Platform)' == '' ">x64</Platform\>
answer5: 回答5:

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

你可以手动插入outputpath财产为DLL类库项目文件。下面是一段/例如它会去。

<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>

您也可以遵循这些步骤:

  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
c#  msbuild