Loading episodes…
0:00 0:00

Imports in Blazor WebAssembly with C# @using

00:00
BACK TO HOME

Imports in Blazor WebAssembly with C# @using

10xTeam August 29, 2020 1 min read

Most often than not, you’ll need to use functionalities from .net libraries in your Blazor WebAssembly applications. In that case, you’ll need to import them via the C# @using directive.

Let’s say you need to use the Debug.WriteLine() method in your Blazor component:

Debug.WriteLine("Hello Blazor!");

You need to import System.Diagnostics with the C# @using directive as follows:

@using System.Diagnostics

If you need to use the method across multiple Blazor components, you can put the import line above in the _Imports.razor file.


Join the 10xdev Community

Subscribe and get 8+ free PDFs that contain detailed roadmaps with recommended learning periods for each programming language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates.

Audio Interrupted

We lost the audio stream. Retry with shorter sentences?