I am using Blazor WebAssmbly 3.1 application. I can not get the printer list. I have tried below code snippets. Its occur error.
@using System.Drawing;
@code {
public List<string> PrinterCollection = new List<string>();
protected override async Task OnInitializedAsync()
{
foreach (string printer in PrinterSettings.InstalledPrinters)
{
PrinterCollection.Add(printer);
}
await base.OnInitializedAsync();
}
}