novotnyllc / MSBuildSdkExtras

Extra properties for MSBuild SDK projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use ExtrasBuildEachRuntimeIdentifier with TargetFrameworks=netcoreapp3.1

AAATechGuy opened this issue · comments

commented

Get the following error:

"D:\src\AdsAppsDB\private\Tools\DB\DBDeploy\DBDeployV2\DBDeployV2.csproj" (default target) (1) ->
(Publish target) ->
  C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets(27,5): error : The 'Publish' target is not supported without specifying a target framework. The current project targets multip
le frameworks, please specify the framework for the published application. [D:\src\AdsAppsDB\private\Tools\DB\DBDeploy\DBDeployV2\DBDeployV2.csproj]

csproj config as follows:

<Project Sdk="MSBuild.Sdk.Extras/2.0.54" DefaultTargets="Build;Publish">
  <PropertyGroup>
    <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
    <OutputType>Exe</OutputType>
    <DebugType>full</DebugType>
    <RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
    <ExtrasBuildEachRuntimeIdentifier>true</ExtrasBuildEachRuntimeIdentifier>
  </PropertyGroup>