错误:没有为项目设置OutputPath属性' Project.Web.csproj'

时间:2017-03-19 09:16:12

标签: visual-studio-2012 jenkins msbuild

构建我的Jenkins / MSBuild解决方案会给我这个错误

Build build 18-03-2017 14:38:15。 项目" C:\ Program Files(x86)\ Jenkins \ workspace \ Development \ Project.Web \ Project.Web.csproj"在节点1上(默认目标)。   C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(609,5): 错误:未为项目' Project.Web.csproj'设置OutputPath属性。请检查以确保这一点  您已为此项目指定了Configuration和Platform的有效组合 配置='推出'平台=' BPC&#39 ;.您可能会看到此消息,因为您正在尝试 构建没有解决方案文件的项目,并指定了非默认的配置或平台 这个项目并不存在。 [C:\ Program Files(x86)\ Jenkins \ workspace \ Development \ Project.Web \ Project.Web.csproj] 完成构建项目" C:\ Program Files(x86)\ Jenkins \ workspace \ Development \ Project.Web \ Project.Web.csproj" (默认目标) - 失败。

构建失败。

" C:\ Program Files(x86)\ Jenkins \ workspace \ Development \ Project.Web \ Project.Web.csproj" (默认目标) (1) - >(_ CheckForInvalidConfigurationAndPlatform target) - >   C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ Microsoft.Common.targets(609,5): 错误:未为项目' Project.Web.csproj'设置OutputPath属性。请检查以确保这一点  您已为此项目指定了Configuration和Platform的有效组合 配置='推出'平台=' BPC&#39 ;.您可能会看到此消息,因为您正在尝试 构建没有解决方案文件的项目,并指定了非默认的配置或平台 这个项目并不存在。 [C:\ Program Files(x86)\ Jenkins \ workspace \ Development \ Project.Web \ Project.Web.csproj]

0 Warning(s)
1 Error(s)

时间流逝00:00:00.61 构建步骤'使用MSBuild构建Visual Studio项目或解决方案'标记为失败 完成:失败

我在.csproj文件中有这个

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{F1258E67-9E32-480033D0}</ProjectGuid>
    <ProjectTypeGuids>{349c5851-65df-165b846f21};{fae04ef79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Project.Web</RootNamespace>
    <AssemblyName>Project.Web</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <MvcBuildViews>false</MvcBuildViews>
    <UseIISExpress>true</UseIISExpress>
    <IISExpressSSLPort />
    <IISExpressAnonymousAuthentication />
    <IISExpressWindowsAuthentication />
    <IISExpressUseClassicPipelineMode />
    <WebGreaseLibPath>..\packages\WebGrease.1.5.2\lib</WebGreaseLibPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-VersionIncrement|Any CPU' ">
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
    <ErrorReport>prompt</ErrorReport>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Any CPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Any CPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>

1 个答案:

答案 0 :(得分:0)

看起来您尝试为当前解决方案的平台和配置构建具有错误项目平台和配置的解决方案。如何在项目中定义平台BPC。检查.sln文件或仅使用.csproj构建MSBuild文件。

相关问题