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

同樣的問題在這裏...... = / –

回答

相關問題