Produce a SDK workload for Blazor WebAssembly AOT #29499
Labels
affected-medium
This issue impacts approximately half of our customers
area-blazor
Includes: Blazor, Razor Components
Done
This issue has been fixed
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
severity-blocking
This label is used by an internal tool
Milestone
Some useful notes to get started:
Design docs
.NET Optional SDK Workloads
Workload Resolvers
Workload Manifests
The workload resolvers design doc has technical details about how workloads will work, as well as guidance for how to create a workload.
Enabling workload resolver
The workload resolver is currently behind a feature flag, and won’t be enabled by default. This is because it came in very late in the release cycle and doesn’t yet do the caching that it needs to do, so we wanted to avoid impacting developers who aren’t using workloads. This issue tracks the remaining work.
To enable the workload resolver, you can either set the
MSBuildEnableWorkloadResolver
environment variable to true, or create a file named EnableWorkloadResolver.sentinel next to the workload resolver DLL. The DLL used will be different for full Framework MSBuild (which is used in Visual Studio and “msbuild” on the command line) and .NET Core MSBuild (which is used by the dotnet CLI). So you will need to create the file in two places if you want to enable the workload resolver that way. The DLL paths will be similar to the following (with highlighted parts likely to change):• C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.dll
• C:\Program Files\dotnet\sdk\5.0.100\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.dll
Additionally (whether you enable the workload resolver via the environment variable or a sentinel file), you will need to copy Newtonsoft.Json.dll version 11.0 to the folder with the full framework MSBuild SDK resolver. You should be able to download the package here and extract the DLL from the lib\net45 folder. We plan to fix this for the GA release of VS 16.8.
Creating a workload
There is a very simple workload in the dotnet/sdk repo that is used for testing the workload features: https://github.com/dotnet/sdk/blob/release/5.0.1xx/src/Assets/TestWorkloads/manifests/Microsoft.NET.Sdk.TestWorkload/WorkloadManifest.json. You can refer to / modify that workload, and refer to the Workload Resolvers design doc for overall guidance.
The text was updated successfully, but these errors were encountered: