question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--runtime or --use-current-runtime with --sc or --selfcontained gives warning warning NETSDK1179: One of '--self-contained' or '--no-self -contained' options are required when '--runtime' is used.

See original GitHub issue

.NET 7 prev. 3 Microsoft ® Build Engine version 17.2.0-preview-22175-02+058a0262c for .NET

UPDATE: maybe I should use --no-self-contained with these projects. I don’t know.

Building a project on Windows or L:inux with --runtime <runtime identifier> or --use-current-runtime and with --sc or --selfcontained gives warning:

  • warning NETSDK1179: One of '--self-contained' or '--no-self -contained' options are required when '--runtime' is used.

Sample command line dotnet build FluentUI.Demo.Shared.csproj --use-current-runtime --sc -o test

Full error: C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(1113,5): warning NETSDK1179: One of '--self-contained' or '--no-self -contained' options are required when '--runtime' is used. [C:\Users\jdkra\Downloads\fast-blazor-main\examples\FluentUI.Demo.Shared\FluentUI.Demo.Shared.csproj]

Using --no-selfcontained works as it should.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, May 14, 2022

This will be fixed in the 6.0.301 release because of this merged PR.

0reactions
redwyrecommented, Sep 15, 2022

I’m getting this issue in 6.0.400, but perhaps not in a situation that was expected:

dotnet publish ".\Tools\Eco.BugReports\Server\Eco.BugReports.Server.csproj" --output $PublishDir --configuration $Config --self-contained true --runtime linux-x64 -fl1 -flp1:errorsonly
MSBuild version 17.3.0+92e077650 for .NET
...
C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(1114,5): error NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used. [D:\jenkins_agent\workspace\Eco Services\Eco Services BugReports PR\Tools\Eco.VersionStampGit\Eco.VersionStampGit.csproj]

You will notice that it’s building a dependent project here which is an exe (a tool used as part of the build process), and it seems it doesn’t get the flag (but I don’t care because it’s not used in the output)

Read more comments on GitHub >

github_iconTop Results From Across the Web

`RuntimeIdentifier` warning if self-contained is unspecified ...
warning NETSDK1179 : One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used.
Read more >
error NETSDK1031: It is not supported to build or publish a ...
I am running following command to publish .NET CORE 5.0 web api project using command line on windows 10 box. c:\test\Service>dotnet publish -c ......
Read more >
Should I use self-contained or framework-dependent ...
In this post I compare the impact of the framework-dependent vs self-contained mode on Docker image size, taking layer caching into account.
Read more >
dotnet-publish: Publishes the application and its ...
NET Core runtime with your application for the specified runtime: dotnet publish --self-contained true --runtime runtime_identifier path/to/project_file ...
Read more >
Self-Contained Applications: Great Tool in .NET 8
It's a great option for deploying .NET applications: the self-contained application's output publishing folder has all the components it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found