sdk: Framework Dependent Publish doesn't work on 2.1.400

Steps to reproduce

Try to publish web api with dotnet publish -f netcoreapp2.0 -c Release, or within visual studio, with framework dependent selected

Expected behavior

Publish around 30 files

Actual behavior

Publishing over 200 files (self-contained)

Environment data

dotnet --info output:

SDK do .NET Core (refletindo qualquer global.json): Version: 2.1.400 Commit: 8642e60a0f

Ambiente de tempo de execução: OS Name: Windows OS Version: 10.0.17134 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.400\

Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0

.NET Core SDKs installed: 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.302 [C:\Program Files\dotnet\sdk] 2.1.400 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:

https://aka.ms/dotnet-download

Description

After upgrading to Visual Studio v15.8, which comes with .net core SDK v2.1.4, I’ve been trying to publish my WebAPI in a Framework Dependent way, but it only generates the Self Contained way, with over 200 files.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 28 (23 by maintainers)

Commits related to this issue

Most upvoted comments

@peterhuene Thank you for writing such a clean and informative commit history for future SDK engineers ❤️

@TatiTheFreaK another workaround if you don’t want to edit your project file is to publish with dotnet publish -f netcoreapp2.0 -c Release --self-contained false. The bug is that SelfContained should be implicitly set to false, but it’s actually an empty string with the 2.1.4xx SDK. I have a fix ready that we hope to get into a 2.1.4xx servicing release. Thanks very much for reporting this issue to us!

MSBuild handling of booleans is baffling

I wouldn’t be surprised if '$(SelfContained)' < 'true' somehow magically worked.

(MSBuild handling of booleans is baffling, btw. Empty string is not coerced to false in such a comparison, but ‘no’ and ‘off’ are.)

This appears to be a regression in the 2.1.400 SDK. Even though the 2.0 runtime is going out of support, the SDK should still support building older TFMs. We cannot make changes to shipped NuGet packages, so we’ll need a fix in Microsoft.NET.Sdk.

@TatiTheFreaK If upgrading to 2.1 is infeasible, try adding this to your .csproj file. In my minimal repro, this appears to workaround the issue.

<PropertyGroup>
  <PublishWithAspNetCoreTargetManifest>true</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

@dasMulli the output folder doesn’t contain these files you mentioned