X

Code coverage reports for ASP.NET Core

Code coverage reports for ASP.NET Core projects are not provided out-of-box but using right tools we can build decent code coverage reports. I needed code coverage reports in some of my projects and here is how I made things work using different free libraries and packages.

Using-declarations in C# 8.0

One of new language features of C# 8.0 is support for using declarations. These declarations enable shorter syntax for declaring disposable variables we want to dispose. Also using declarations give us a little bit cleaner code while compiler makes a dirty work of producing correct code that takes care of disposing disposable variables.

Automated date based versioning for ASP.NET Core assemblies using Azure DevOps

I needed automatic version numbering based on current date when web application is built. It was wish by some customers and in their projects it’s okay with it. As their code is covered with automated tests and other diagnostics I’m using Azure DevOps as build server and this is where I made automated date based versioning work.

ASP.NET Core: Replacement for Server.MapPath

There’s no Server.MapPath() in ASP.NET Core and things are way different than with old ASP.NET MVC. This blog post shows how application and public web files are organized in ASP.NET Core and how to access them from web applications.

Reading GPS coordinates of photo on ASP.NET Core

During one of my ASP.NET Core classes I made demo about how to read GPS coordinates from photo and display location on a map. I took my favorite photo of beer kiosk in Krakow and displayed location of this kiosk on map. This blog post describes my experiment on getting GPS coordinates from EXIF data in ASP.NET Core application.

Building offline Blazor application

I made one small experiment and tried to get simple client-side Blazor application running on browser in offline mode. Yes, offline – visit application page once, turn out internet connection, open browser, type in application URL and it just runs. This blog post is short illustrated overview of my experiment.

Server-side Blazor applications

Lately Blazor got important update – support for server-side Blazor applications. This blog post introduces how server-side Blazor applications work and what are pros and cons when considering building these.

String repeat method for C#

C# doesn’t have built-in function to repeat a string. There are different version for string.Repeat() available in internet and it’s up to reader to find out which version works better. Here is the list of most popular implementations I found across the web. I list my findings here with the results of simple performance test.

ASP.NET MVC error: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level

Error when running ASP.NET MVC application from Visual Studio: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Stop inventing painful hacks, solution is here.

Adding search to Blazor applications

As my Blazor demo application supports now Azure AD I took the next step and implemented search using Azure Search service. This blog post shows how to add search capabilities to Blazor application using Azure Functions back.end and Azure Search service.