-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With .NET SDK 6.0.300-preview.22154.4, warning NETSDK1179 still shows when running "dotnet publish -r win-x64 --self-contained" in CLI #24269
Comments
This issue is in 6.0.3 but works fine in 6.0.202. Upgrading breaks builds. For now, going to force the older 6.0.202 version of dotnet to avoid the issue. |
Same issue for us |
Same here with |
This problem also popped-up in our Azure DevOps pipeline. And in combination with /warnaserror is breaking our build... |
@marcpopMSFT this is affecting customer builds and appears to be a significant regression in the new 6.0.300 SDK. It has currently been pushed to 6.0.4xx, but it surely needs fixing as a priority. |
Brief triage:
I think there may be some corner cases here with libraries (since they don't tend to be targeting .NetCoreApp?) where this condition is never set. We may need a last-chance check for this |
@baronfel what is the official way to specify not self-contained? The docs say it is Maybe that is unrelated to the core issue here |
It is unrelated to the core issue, but has a simple answer: Due to vagueness in the implementation of the options, you can actually use |
also getting this when upgrading from 6.0.202 to 6.0.300
all our exes are built self contained |
It seems this was a known regression in 6.0.300 before it was released, what was the rationale of leaving it as-is for the release? |
Folks, a workaround in the interim is: If you're definitely providing the You can see the before and after here: raw form of the above image14:19:37 ❯ dotnet publish -r win10-x64 -bl --self-contained
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\6.0.300\MSBuild.dll -bl -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\6.0.300\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\6.0.300\dotnet.dll -maxcpucount -property:SelfContained=True -property:_CommandLineDefinedSelfContained=true -property:RuntimeIdentifier=win10-x64 -property:_CommandLineDefinedRuntimeIdentifier=true -restore -target:Publish -verbosity:m .\app.csproj
Determining projects to restore...
All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(1114,5): warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used. [D:\Code\Sc
ratch\6.0-selfcontained\app\app.csproj]
C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(1114,5): warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used. [D:\Code\Sc
ratch\6.0-selfcontained\lib\lib.csproj]
lib -> D:\Code\Scratch\6.0-selfcontained\lib\bin\Debug\net6.0\lib.dll
app -> D:\Code\Scratch\6.0-selfcontained\app\bin\Debug\net6.0\win10-x64\app.dll
app -> D:\Code\Scratch\6.0-selfcontained\app\bin\Debug\net6.0\win10-x64\publish\
14:22:32 ❯ dotnet publish -r win10-x64 -bl --self-contained -p:NoWarn=NETSDK1179
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\6.0.300\MSBuild.dll -bl -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\6.0.300\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\6.0.300\dotnet.dll -maxcpucount -property:SelfContained=True -property:_CommandLineDefinedSelfContained=true -property:RuntimeIdentifier=win10-x64 -property:_CommandLineDefinedRuntimeIdentifier=true -p:NoWarn=NETSDK1179 -restore -target:Publish -verbosity:m .\app.csproj
Determining projects to restore...
All projects are up-to-date for restore.
lib -> D:\Code\Scratch\6.0-selfcontained\lib\bin\Debug\net6.0\lib.dll
app -> D:\Code\Scratch\6.0-selfcontained\app\bin\Debug\net6.0\win10-x64\app.dll
app -> D:\Code\Scratch\6.0-selfcontained\app\bin\Debug\net6.0\win10-x64\publish\ |
@baronfel, if there's a trivial workaround as you suggest, wouldn't it be overall way less effort to issue a hotfix release that contains the workaround until the issue is properly fixed; as opposed to expecting a multitude of customers to individually and manually apply the workaround, and put them in a precarious position where it's easy to forget about it and permanently disable this warning as an unintended side effect? |
@nagya we're working on a fix quickly in the linked PR and will be taking it to servicing. |
note that the |
We got approval to fix this in 6.0.301 servicing. That is currently planned for release in June. |
Great news. However @marcpopMSFT, trying to understand how this issue (which affects many people) was known before release (back on March 8th), but still made it out. Realizing it would affect automated builds everywhere... |
@waynebrantley we didn't catch during triage that this was different than #23999 which we thought we'd already fixed so assumed this issue as much narrower than it was. We'll be reviewing our triage process but folks can also ping us directly to get attention on issues we may be missing. |
@marcpopMSFT Hey, things get missed - it happens! As far as the triage process, I was not referring to the ticket you referenced - I was referencing this ticket. Anyway, glad you guys are on it. Thank you very much!! |
It still reproduces for 6.0.403 |
Are you using 6.0.403 with 17.4 by any chance? |
Please re-open this. This seem to be not fixed and it also happens when calling |
Per my question above, we have a known issue where we'll still show this warning in the specific combination of 17.4 and 6.0.400. At the moment, we do not have plans to address this though I'm open to continued feedback. I would like to understand why customers are choosing to use 6.0.400 with 17.4 as .400 includes tooling from 17.3 and is tested with 17.3. While you can overwrite the values through global.json, we don't recommend doing that with Visual Studio/msbuild if you can help it. |
Ah, okay. In my current scenario we have still netcoreapp3.1, net6.0 and net7.0 projects together. Migrating them takes time (they grew for a few years ;) ). So I use the dotnet command with the |
Could you try using the 7.0.100 SDK to build all three projects? It should be able to build them and would avoid the issue I mentioned above where 17.4 + 6.0.400 has an issue. |
Environment: .NET SDK 6.0.300-preview.22154.4 (runtime-6.0.2)
Repro steps:
Expected Result:
Warning NETSDK1179 should not display.
Actual Result:
warning NETSDK1179 still shows after adding '--self-contained' or '--no-self-contained'.
Dotnet info:
.NET SDK (reflecting any global.json):
Version: 6.0.300-preview.22151.9
Commit: c5b0a45
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.300-preview.22151.9\
Host (useful for support):
Version: 6.0.2
Commit: 839cdfb0ec
.NET SDKs installed:
6.0.300-preview.22151.9 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
The text was updated successfully, but these errors were encountered: