Skip to content

Publish does not natively handle multitargeting like Build does #2597

@dfederm

Description

@dfederm

For a project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp2.1;net47</TargetFrameworks>
  </PropertyGroup>
</Project>

I can do msbuild (or msbuild /t:Build), and the execution will consist of an outer build which simply does an inner build for each TFM (adding a specific TargetFramework=<tfm> global property for each).

I would expect msbuild /t:Publish to behave the same way, to simply have an outer build which did an inner build for each TFM. Instead, the following error is shown:

The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, please specify the framework for the published application

Why can't Publish when there are multiple TFMs just Publish for each TFM?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions