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

[DOTNET9] dotnet build causes error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. #18796

Closed
EricKwon94 opened this issue Nov 15, 2024 · 2 comments · Fixed by #18853
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@EricKwon94
Copy link

EricKwon94 commented Nov 15, 2024

UnoApp2.zip

Error Message

error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project.

Issue Summary:

When net9.0-browserwasm is included in the TargetFrameworksof the .csproj file, the following build commands fail:
dotnet build UnoApp2.csproj -c:Release -f:net9.0-android -r:android-arm64
dotnet build UnoApp2.csproj -c Release -f net9.0-ios -r iossimulator-x64

Error Details:

  • The build fails specifically when using -r:android-arm64 or -r:iossimulator-x64.
  • If net9.0-browserwasm is removed from TargetFrameworks, the commands work correctly.
  • The issue does not occur if the -r (runtime identifier) option is omitted.
  • This problem does not occur with .NET 8; the same project builds successfully with .NET 8.

Environment

.NET SDK Version: 9.0
VisualStudio 17.12.0
Windows 11

Expected behavior

The project should build successfully with .NET 9 using the specified commands, regardless of whether net9.0-browserwasm is included in the TargetFrameworks.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android, iOS

IDE

Visual Studio 2022, Visual Studio Code

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@EricKwon94 EricKwon94 added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 15, 2024
@jeromelaban
Copy link
Member

Thanks for the report.

This is likely a .NET SDK bug that we may not be able to fix from our end.

Still, in the meantime, it's best to set the RuntimeIdentifiers property:

dotnet build -c Release -f net9.0-ios -p:RuntimeIdentifiers=iossimulator-x64

@jeromelaban jeromelaban added project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools and removed triage/untriaged Indicates an issue requires triaging or verification labels Nov 15, 2024
@EricKwon94
Copy link
Author

Debugging Issue on Mac + VSCode with iOS Simulator

When debugging on Mac using VSCode with the iOS Simulator, the -r:iossimulator-arm64 option is forcibly applied.
This causes the error mentioned above, making it impossible to debug in this setup.

Is there any way to resolve this issue?
Should I modify specific settings or apply additional flags?

Thank you in advance for your help! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants