Skip to content
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

Warning NETSDK1179 is always raised #25366

Closed
nagya opened this issue May 11, 2022 · 1 comment
Closed

Warning NETSDK1179 is always raised #25366

nagya opened this issue May 11, 2022 · 1 comment

Comments

@nagya
Copy link

nagya commented May 11, 2022

Describe the bug

The warning NETSDK1179 is always raised when the --runtime switch is used, even if --self-contained or --no-self-contained is also used. This started in the 6.0.300 stable release, and unconditionally: when the --self-contained switch is used, when the --no-self-contained switch is used, or when neither switch is used. It's impossible to get warning-free behavior. In a typical CI scenario, where warnings are treated as errors, this bug unconditionally fails all builds.

To Reproduce

% cat Test1.csproj  ## no other files in the project
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>
</Project>

% dotnet --version
6.0.300

% dotnet build --self-contained --runtime osx-x64  
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/nagya/ms/Test1B/Test1.csproj (in 115 ms).
/usr/local/share/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. [Test1.csproj]
  Test1 -> /Users/nagya/ms/Test1B/bin/Debug/net6.0/osx-x64/Test1.dll

Build succeeded.

/usr/local/share/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. [Test1.csproj]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.09
% 


Exceptions (if any)

Further technical details

% dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.300
 Commit:    8473146e7d

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.3
 OS Platform: Darwin
 RID:         osx.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.300/

Host (useful for support):
  Version: 6.0.5
  Commit:  70ae3df4a6

.NET SDKs installed:
  6.0.300 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
@baronfel
Copy link
Member

This is a duplicate of #24269. Despite the name of the issue, the root cause is the same.

@baronfel baronfel removed the untriaged Request triage from a team member label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants