1

我使用以下命令行:的MSBuild创建sfproj包失败:该OutputPath属性未设置项目

"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" MyApp.sln /p:configuration="Release" /t:Build 
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" MyApp.sfproj /p:platform="Any CPU" /p:configuration="Release" /t:Package 

第一线工作正常,但第二次失败,出现错误

"MyApp.sfproj" (Package target) (1) -> 
"AppProj.csproj" (default target) (4) -> 
    C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'AppProj.csproj'. 
    Please check to make sure that you have specified a validcombination of Configuration and Platform for this project. 
    Configuration='Release' Platform='Any CPU'. 
    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. [AppProj.csproj] 

对于我的应用程序中的一些项目。

我在相关csproj定义如下PropertyGroup

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\x64\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <PlatformTarget>x64</PlatformTarget> 
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\x64\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <PlatformTarget>x64</PlatformTarget> 
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 
    </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> 

当我从VS2015/2017年部署的应用程序它的伟大工程,如预期的那样创建bin\pkg

+0

我也试过'Platfrom = x64',因为显然织物只能与它一起工作。没有改变任何东西。 – Mugen

+0

同样的问题在这里...... = / –

回答

相关问题