Skip to content

Check that SDK and app archs match before setting DOTNET_ROOT when using dotnet run#19860

Merged
mateoatr merged 9 commits intodotnet:mainfrom
mateoatr:checkArchDotNetRoot
Aug 24, 2021
Merged

Check that SDK and app archs match before setting DOTNET_ROOT when using dotnet run#19860
mateoatr merged 9 commits intodotnet:mainfrom
mateoatr:checkArchDotNetRoot

Conversation

@mateoatr
Copy link
Contributor

Fixes #19743. I tested this locally. The steps for reproing the fix are already in the above issue. For checking the app's architecture, this first checks for the RuntimeIdentifier property of the project to run, if not set, it'll grab the architecture from the DefaultAppHostRuntimeIdentifier prop.

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - please wait for SDK owners to also review this.

Allow test asset copy
@richlander
Copy link
Member

Can/will enthusiastically test this as soon as there is a build.

@mateoatr mateoatr merged commit 36e9be0 into dotnet:main Aug 24, 2021
agocke added a commit that referenced this pull request Aug 31, 2021
…using `dotnet run` (#19860) (#20102)

Check that dotnet arch and app's arch match before setting DOTNET_ROOT

(cherry picked from commit 36e9be0)

Co-authored-by: Mateo Torres-Ruiz <mateoatr@users.noreply.github.com>
@Algorithman
Copy link

Question: Is this already in the release/when will this be in the installer?

@vitek-karas
Copy link
Member

This fix is in .NET 6 GA - so if you download the final release of .NET 6, it should be there.

@Algorithman
Copy link

Thx. Correct if i'm wrong, i need to uninstall .net5 then?

@vitek-karas
Copy link
Member

You should not need to uninstall .NET 5. The SDKs are side by side - so both can be installed. By default commands like dotnet run should pick the latest version (so if you have .NET6 it should use .NET 6). Unless you're using global.json files which can specify exact SDK version to use.

You can try this by running dotnet --info from the directory where you would run dotnet run. It should print out something like:

.NET SDK (reflecting any global.json):
 Version:   6.0.200-preview.21573.3
 Commit:    a2bb0dde82

Which will contain the exact SDK version used by the command (and dotnet run should use the same version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview 7 UX for Arm64/x64 co-existence on macOS

5 participants