MSBuild creating sfproj package fails: The OutputPath property is not set for project

Viewed 1747

I'm using the following command lines:

"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

First line works fine, but second fails with the error

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

for some projects in my application.

I have the following PropertyGroup defined in the relevant csproj:

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

When I deploy application from VS2015/2017 it works great and bin\pkg is created as expected.

1 Answers
Related