Skip to content
Deploy ML.NET Model alongside Blazor WebAssembly static website sample
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

ML.NET Blazor WebAssembly Static Website Sample

This application trains a multiclass classification model to predict iris flower types and deploys the model alongside a Blazor WebAssembly static website.

For more details, see the accompanying blog post Deploy ML.NET Machine Learning Model in Blazor WebAssembly Static Website.


This project was built on a Windows PC but should work cross platform on Mac and Linux.

Solution Description

The solution three projects:

  • SchemaLibrary: C# .NET Standard 2.0 class library that contains the schema definition classes of the data used to train the model as well as the prediction output generated by the model.
  • TrainingConsole: C# .NET Core 3.1 console application used to train the machine learning model.
  • BlazorWebApp: Blazor WebAssembly web application to make predictions using machine learning model trained by TrainingConsole application.

Train the model

In the TrainConsole project directory, use the following command to run the application and train the model:

dotnet run

Run the web application

Note that CORS settings may have to be set up in Azure Storage to use localhost

In the BlazorWebApp project directory, use the following command to start the web application:

dotnet run
You can’t perform that action at this time.