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

self-contained warning should be suppressed for iOS #23705

Closed
eerhardt opened this issue Feb 1, 2022 · 5 comments
Closed

self-contained warning should be suppressed for iOS #23705

eerhardt opened this issue Feb 1, 2022 · 5 comments
Assignees
Labels
Area-NetSDK good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined.
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Feb 1, 2022

Describe the bug

When publishing for iOS you need to specify a RuntimeIdentifier. See xamarin/xamarin-macios#13462 and xamarin/xamarin-macios#12997.

However, when you try to publish for -f net6.0-ios -r ios-arm64, you get a warning:

/.../Microsoft.NET.Sdk.targets(1110,5): warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used. [/Users/eerhardt/DotNetTest/MauiTest/NoHosting/NoHosting.csproj]

This doesn't make sense in an iOS app because you can only publish self-contained.

To Reproduce

  1. dotnet workload install maui
  2. dotnet new maui
  3. dotnet publish -c Release -f net6.0-ios -r ios-arm64

Warnings

/.../Microsoft.NET.Sdk.targets(1110,5): warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used. [/Users/eerhardt/DotNetTest/MauiTest/NoHosting/NoHosting.csproj]

Further technical details

% dotnet --info                                                           
.NET SDK (reflecting any global.json):
 Version:   6.0.200-preview.22063.5
 Commit:    2d72e717b3

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.2
 OS Platform: Darwin
 RID:         osx.12-x64
 Base Path:   /Users/eerhardt/git/maui/bin/dotnet/sdk/6.0.200-preview.22063.5/

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  6.0.200-preview.22063.5 [/Users/eerhardt/git/maui/bin/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [/Users/eerhardt/git/maui/bin/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [/Users/eerhardt/git/maui/bin/dotnet/shared/Microsoft.NETCore.App]

cc @dsplaisted @rolfbjarne

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Linux untriaged Request triage from a team member labels Feb 1, 2022
@dsplaisted dsplaisted added the good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. label Feb 2, 2022
@dsplaisted dsplaisted added this to the 6.0.3xx milestone Feb 2, 2022
@dsplaisted dsplaisted added Area-NetSDK needs team triage Requires a full team discussion and removed untriaged Request triage from a team member Area-Linux labels Feb 2, 2022
@marcpopMSFT
Copy link
Member

We should check if self-contained is set at all rather than specifically the command line.

@marcpopMSFT marcpopMSFT removed the needs team triage Requires a full team discussion label Feb 2, 2022
gkulin added a commit that referenced this issue Feb 17, 2022
gkulin added a commit that referenced this issue Feb 18, 2022
Fix self-contained warning - addressing bug #23705
@jonathanpeppers
Copy link
Member

We noticed this happens on Android as well. Mobile platforms define $(SelfContained) to be true by default in their MSBuild targets.

@dsplaisted
Copy link
Member

@jonathanpeppers Yes, the fix applies to iOS and Android, as well as projects which explicitly set SelfContained to true.

@mattjohnsonpint
Copy link

FYI I'm on 6.0.400 latest and I'm still getting this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined.
Projects
None yet
Development

No branches or pull requests

6 participants