You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can be straightforwardly adapted to Windows. That's what I'll be doing.
There are a few places where you'll likely run into troubles. These instructions likely won't work well for the general public until RC2 is released. The nightly builds are currently broken. I ran through all of this with internal builds.
Start with Arm64
First, install an Arm64 build.
Note: The instructions for each scenario assume you got back somewhere rational, like cd ~.
Run an app.
dotnet new console -o app
cd app
dotnet run
Update the app to report the processor architecture, with the following change to Program.cs
Arm64 + x64 emulation test plan
This is a good take on testing this new environment.
Can be straightforwardly adapted to Windows. That's what I'll be doing.
There are a few places where you'll likely run into troubles. These instructions likely won't work well for the general public until RC2 is released. The nightly builds are currently broken. I ran through all of this with internal builds.
Start with Arm64
First, install an Arm64 build.
Note: The instructions for each scenario assume you got back somewhere rational, like
cd ~
.Run an app.
dotnet new console -o app
cd app
dotnet run
dotnet run
Update to Program.cs
Install a tool (best to use a random name due to name squatting).
dotnet new console -o app4321
cd app4321
dotnet pack -p:PackAsTool=true
dotnet tool install -g app4321 --add-source bin/Debug
app4321
Note: Use
codesign -s - ~/.dotnet/tools/app4321
if the tool is killed by the macOS notary.Use
dotnet-watch
with an ASP.NET app.dotnet new webapp -o webapp
cd webapp
code .
dotnet watch run
Index.cshtml
:<h1 class="display-4">Welcome @RuntimeInformation.OSArchitecture</h1>
CTRL-C
Run tests.
dotnet new xunit -o tests
cd tests
dotnet test
Test x64 emulation
Install the .NET 6 x64 SDK. We're primarily installing the SDK to get the runtimes, as opposed to using the SDK itself.
Repeat the tasks but with arch-specific flags that coerce the us of the x64 runtime.
Note: It is assumed all the same apps exist as directed above. Commands are not provided to re-create them.
Run app with x64 runtime.
cd app
dotnet run -a x64
dotnet run
Run the tool.
cd app4321
dotnet tool uninstall -g app4321
dotnet tool install -g app4321 --add-source bin/Debug -a x64
app4321
dotnet tool uninstall -g app4321
dotnet tool install -g app4321 --add-source bin/Debug
dotnet tool uninstall -g app4321
Note: Use
codesign -s - ~/.dotnet/tools/app4321
if the tool is killed by the macOS notary.Use
dotnet-watch
with an ASP.NET app.cd webapp
dotnet watch run -a x64
CTRL-C
dotnet watch run
CTRL-C
Run tests.
cd tests
dotnet test --arch x64
Validate the x64 test
We should also ensure the x64 SDK works. Here's one trick for easily using the x64 SDK.
export OLDPATH=$PATH
export PATH=/usr/local/share/dotnet/x64:$PATH
dotnet --info | grep RID
You should see x64.
cd app
dotnet run
You should see x64.
dotnet run -a arm64
This currently fails.
Let's try the tool.
dotnet tool uninstall -g app4321
dotnet tool install -g app4321 --add-source bin/Debug
app4321
dotnet tool uninstall -g app4321
dotnet tool install -g app4321 --add-source bin/Debug -a arm64
app4321
Note: Use
codesign -s - ~/.dotnet/tools/app4321
if the tool is killed by the macOS notary.Let's try dotnet watch.
cd webapp
dotnet watch run
CTRL-C
dotnet watch run -a arm64
CTRL-C
Let's finish up with testing.
cd tests
dotnet test
dotnet test --arch arm64
Let's fixup the path back.
export PATH=$OLDPATH
Test .NET Core 3.1 (x64 only)
Download the latest .NET Core 3.1 ASP.NET Core binaries package and unpack to the x64 hive.
sudo tar -xf Downloads/aspnetcore-runtime-3.1.19-osx-x64.tar.gz -C /usr/local/share/dotnet/x64
Let's validate we are using the Arm64 SDK.
dotnet --info | grep RID
We now need a .NET Core 3.1 app. We can use the .NET Core repo for that.
git clone https://github.com/dotnet/core
cd core/samples/dotnet-runtimeinfo
dotnet run
We can try an official tool now.
dotnet tool install -g dotnet-runtimeinfo
dotnet-runtimeinfo
dotnet tool uninstall -g dotnet-runtimeinfo
dotnet tool install -g dotnet-runtimeinfo -a x64
dotnet-runtimeinfo
Note: Use
codesign -s - ~/.dotnet/tools/dotnet-runtimeinfo
if the tool is killed by the macOS notary.We can use
dotnet-watch
on thedotnet-runtimeinfo
source.dotnet watch run
CTRL-C
Let's try same with the x64 SDK.
/usr/local/share/dotnet/x64/dotnet watch run
CTRL-C
Let's try testing, but using the test sample from above.
cd tests
TargetFramework
tonetcoreapp3.1
in the project file.Nullable
line from the project file.@namespace
line inProgram.cs
dotnet test
The text was updated successfully, but these errors were encountered: