-
Install the latest preview SDK:
- Install dotnet-install script from https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
dotnet-install -Channel main -InstallDir <some-install-dir>
- Add
<some-install-dir>
to your path so you're using it for the next steps
-
Install the blazor-aot tool and acquire the SDK
dotnet new nugetconfig
- edit the
nuget.config
file to include nightly feed:+ <add key="aspnetcore" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
- Install the tool
dotnet new tool-manifest dotnet tool install dotnet-install-blazoraot --version 6.0.0-*
- Run the tool to install workload + packs
dotnet install-blazoraot
- Due to a bug in the workload authoring, python needs to be manually installed on Windows and MacOS. Follow the instructions here https://emscripten.org/docs/getting_started/downloads.html#platform-specific-notes to acquire it.
-
Create a new Blazor WebAssembly app and enable AOT
dotnet new blazorwasm
- Open up the project file and configure it to use AOT
<PropertyGroup> <RunAOTCompilation>true</RunAOTCompilation> </PropertyGroup>
-
dotnet publish
Last active
April 22, 2021 18:45
-
-
Save pranavkm/1ca9eca9605ebc89161cb33e02e74e85 to your computer and use it in GitHub Desktop.
AOT for Blazor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried it today and had trouble with the latest version of the
dotnet-install-blazoraot
tool.I was able to overcome it by installing the preview.3 version, like this:
dotnet tool install dotnet-install-blazoraot --version 6.0.0-preview.3
.Update: recently I used preview.4 instead