Setup VSCode for C# development

Ubuntu 18.04 , 19.04

Dotnet Sdk 3.0 release installation

Install it directly from the software repository.


Remove all versions of mono completely from the system, vscode & omnisharp comes with the mono included, the incorrect version on the system will interfere with the embedded runtime and will not work correctly .

 igorb@desktop:~$ mono --version
 Command 'mono' not found, but can be installed with:
 sudo apt install mono-runtime 

VSCode installation

Download VSCode and install it.

Open downloaded deb file with “Open with software install” and install it.

Hide some folders from file explorer

As explained here just set files to exclude.

Search for “files:exclude” and add bin and obj folder to the list of excluded entities.


Add to favorites on Ubuntu

This is maybe some odd advice but, when you add Code to favorite applications (to the launcher) you do that from the Show Applications menu !

If you start code from the terminal and mark newly showed icon as “Add to favorites” , the Code somehow doesn’t compile and debug correctly. There is some strange errors after succesfully builded solution…

C# project build errors

In case of errors on build , make sure you have only one dotnet sdk installed on your system (ubuntu).

igorb@desktop:~$ dotnet --list-sdks
3.0.100 [/usr/share/dotnet/sdk]

Omnisharp project build errors

In case of any errors on the project load (OmniSharp log in the output terminal), like :

OmniSharp.MSBuild.ProjectManager        Failed to load project file '/mnt/development/GitHub/Bisaga/About.Application/About.Application.csproj'.

Add build path to the /etc/profile file, do not forget to re-login:

export MSBuildSDKsPath="/usr/share/dotnet/sdk/$(dotnet --version)/Sdks"

Change number of notifying instances

echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

EmbeddedBlazorContent – how to include static content from blazor libraries

If you want to include some static resources from the Blazor component library use “EmbeddedBlazorContent” tool.


Create static content in Blazor component library

Create “content” folder in the root of the library project and add CSS and JS files in.

Add embeded resource build action on all the files

Open properties on each resource file and select “Embedded resource” build action on it.

Additional attributes for embedded resource in the project file

Open .CSPROJ project file and edit EmbeddedResource definition to have additional LogicalName definition.

For CSS files:


For JS files:



    <EmbeddedResource Include="content\bisaga_core.css">
    <EmbeddedResource Include="content\bisaga_core.js">

Add EmbeddedBlazorContent library to blazor server side web project


Add configuration for embeded content library to Configure metod in Startup.cs

# Startup.cs


Add call to EmbeddedBlazorContent where you wish to include embedded files.

@using EmbeddedBlazorContent


Syncfusion EJ2 AspNet Core Blazor components installation

If you need professional and supported set of components for server side / client side Blazor web applications use Syncfusion components.

More info:

Installation – NuGet packages :

  • Syncfusion.EJ2.Blazor


Configure method

Licensing is not needed in case of preview version and library don’t even contain “Licensing” namespace.

// Register Syncfusion license
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("...licence string...");


@addTagHelper *, Syncfusion.EJ2.Blazor

    <link href="" rel="stylesheet" />
    <!--    <link href="" rel="stylesheet" />-->
    <!--    <link href="" rel="stylesheet" />-->
    <script src=""></script>
    <script src=""></script></head>


@using Syncfusion.EJ2.Blazor<br>
@using Syncfusion.EJ2.Blazor.Calendars

Components usage in razor files

@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<br />

The result

If everything is deployed as expected you should see similar result page:

MatBlazor components installation

AspNet Core – Server side Blazor framework


If you need open source components for Blazor you definitively need to look at MatBlazor component library.


  • MatBlazor nuget library
  • EmbeddedBlazorContent nuget library (for server side blazor projects)


Configure method

// Embedded blazor content get static content from depended DLLs 


Add additional “using” statement for MatBlazor

@using MatBlazor


@addTagHelper *, MatBlazor
@using EmbeddedBlazorContent

    <!-- static resources from dependent blazor libraries -->

Application bar sample

In the NavMenu.razor file add:

    <MatAppBar Fixed="true">
                <MatIconButton Icon="menu"></MatIconButton>
                <MatAppBarTitle>Trade scanner</MatAppBarTitle>
            <MatAppBarSection Align="@MatAppBarSectionAlign.End">
                <MatIconButton Icon="favorite"></MatIconButton>

After compile your application should look something like :

Blazor components are encoded without namespaces, it means @addTagHelper and @using statements are in place and working.