error CS0234: The type or namespace name 'Printing' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?)

Viewed 126

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();
    }
}
0 Answers
Related