This repository demonstrates how to set up a Blazor WebAssembly project targeting .NET 8.0 with ScottPlot integration for data visualization. Follow the steps below to replicate the environment and run the project.
- .NET SDK installed on your system. Confirm your versions:
> dotnet --list-sdks 7.0.410 [C:\Program Files\dotnet\sdk] 8.0.307 [C:\Program Files\dotnet\sdk] 8.0.404 [C:\Program Files\dotnet\sdk] 9.0.100 [C:\Program Files\dotnet\sdk]
- Installed workloads for WebAssembly development. Check with:
> dotnet workload list wasm-tools 9.0.0/9.0.100 SDK 9.0.100, VS 17.12.35521.163
Install the WebAssembly tools for .NET 8.0:
dotnet workload install wasm-tools-net8
Verify the installation:
> dotnet workload list
wasm-tools 9.0.0/9.0.100 SDK 9.0.100, VS 17.12.35521.163
wasm-tools-net8 9.0.0/9.0.100 SDK 9.0.100
-
Create a new Blazor WebAssembly project targeting .NET 8.0:
dotnet new blazorwasm -f net8.0
-
Add the ScottPlot.Blazor package for data visualization:
dotnet add package ScottPlot.Blazor
-
Create a solution file and add the project:
dotnet new sln dotnet sln add .
-
Reference the ScottPlot Blazor Quickstart Documentation for integration details.
Run the application locally:
dotnet run
-
Publish the project for production:
dotnet publish try-blazorwasm-with-plot.csproj -c Release -o publish
-
Serve the published files:
dotnet serve -o -S -p:5143 -b -d:.\publish\wwwroot\
- Ensure your .NET SDK is up to date to avoid compatibility issues.
- ScottPlot.Blazor provides an easy-to-use API for embedding interactive plots in Blazor WebAssembly applications.