Kristoffer Strube

Kristoffer Strube

Denmark
20 posts
Blazor WASM 404 error and fix for GitHub Pages

The project structure of a Blazor WASM project is in some places very different than other frontend frameworks in the .NET stack. One of the nice things about Blazor WASM is that it can be hosted by any static file host. A problem with this is that routing is handled ...

Easy generation of fake/dummy data in C# with Faker.Net

When developing, testing, or showcasing something it's often important to use data that is not real data. Either because you might not have actual data available yet or because you don't want to show or pick the data from real users which can contain sensitive information. Faker.Net can help ...

Generate iCal calendar with .NET using iCAL.NET

Calendars are a great part of many people's every-day-life. Integrations with calendars can be a great way to interact very directly with your users and is often a very sought after feature if you have some kind of events as part of your platform. In this article, we will show ...

Using JS Object References in Blazor WASM to wrap JS libraries

Among the .NET 5 Blazor improvements there are IJSObjectReference's (JavaScript Object References). The name indicates that this can only be used to isolate JavaScript sources similar to CSS Isolation. But IJSObjectReference can do so much more than just isolation. ...

How to fix Blazor WASM base path problems

A lot of people were intrigued when we got to know that Blazor WASM would come with features like client-side routing. But Blazor WASM applications are still Single Page Applications (SPAs) at their core. This means that they have the same restrictions as any other SPA framework. In this post, ...

How to add User-Agent header to HttpClient in .NET

An intrinsic part of the modern web application is the ability to use external APIs and webpages. In .NET this is done using the HttpClient class. The HttpClient class does not add the field User-Agent out of the box. According to the HTTP standard, it is recommended that this is ...

Call anonymous C# functions from JS in Blazor WASM

In this article, we will look at how we can call C# functions from a JS library in Blazor WASM. This can be useful to integrate with existing JS libraries that react to different events. This article is a continuation of a project made in our other article Wrapping JavaScript ...

How to send push notifications to a browser in ASP.NET Core

Progressive Web Apps (PWAs) enables a website to make make a lot of interactions that are app-like. Among these are Push Notifications. This is a functionality that enables you to make native notifications for many different devices and to invoke these notifications even when the browser is not active. A ...

Wrapping JavaScript libraries in Blazor WebAssembly/WASM

Blazor WebAssembly is one of the newest front-end frameworks on the block. It enables you to write frontend in C# and makes it possible to use many of the .NET libraries that you already know. Most websites use some JavaScript libraries that make it easier to make complex animations, self-aligning ...