sdk: [SDK 6.0.100-preview.2.21155.3] the single exe of 'dotnet publish' cause error 'api-ms-win-core-winrt-l1-1-0.dll is missing'

[SDK 6.0.100-preview.2.21155.3] the single exe of ‘dotnet publish’ cause error ‘api-ms-win-core-winrt-l1-1-0.dll is missing’

os:windows 7 dotnet sdk: SDK 6.0.100-preview.2.21155.3 download as Binaries, not as Installers

set DOTNET_ROOT=D:\hpc-bio\dotnet\dotnet-sdk-6.0
%DOTNET_ROOT%\dotnet build -c Release AppNet60.csproj

%DOTNET_ROOT%\dotnet publish -c Release /p:PublishSingleFile=true /p:SelfContained=true /p:PublishTrimmed=true /p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRunShowWarnings=true --framework net6.0-windows  -r win7-x64 AppNet60.csproj

the api-ms-win-core-winrt-l1-1-0.dll is not found in D:\hpc-bio\dotnet\dotnet-sdk-6.0 too.

as a compare, .net sdk v5.0.4 works well.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Is it possible to use the “old publish” with NET6? I really need self-contained single-file executables on Win7 and I also need the most recent C# version. So this is a huge problem. I don’t care if the files are extracted or not but I need to be able to create such file with NET6/C#10 support.

current:


D:\dotnet\lib_fmt_tests\AppNet6>D:\hpc-bio\dotnet\dotnet-sdk-6.0\dotnet publish -c Release /p:PublishSingleFile=true /p:SelfContained=true --self-contained /p:PublishTrimmed=false /p:PublishReadyToRun=true -p:IncludeNati
veLibrariesForSelfExtract=true -p:PublishReadyToRunShowWarnings=true --framework net6.0-windows  -r win7-x64 AppNet60.csproj
Microsoft (R) Build Engine version 17.0.0-preview-21460-01+8f208e609 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored D:\dotnet\lib_fmt_tests\AppNet6\AppNet60.csproj (in 311 ms).
D:\hpc-bio\dotnet\dotnet-sdk-6.0\sdk\6.0.100-rc.1.21463.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(162,5): error NETSDK1180: Specified runtime identifier 'win7-x64'' implies Windows
 7 compatibility. Single File publishing is not compatible with Windows 7. [D:\dotnet\lib_fmt_tests\AppNet6\AppNet60.csproj]

Could we remove this limitation added in .net 6.0?