Using Roslyn refactorings with OmniSharp and Visual Studio Code
One of the features that we added to a recent OmniSharp release (which, as a reminder, backs the C# language services in various editors), and that quietly shipped in C# for Visual Studio Code 1.10.0 last week, was the ability to use external Roslyn refactorings.
Before, OmniSharp shipped with some built-in Roslyn refactorings (i.e. move type to file) but this new feature allows a user to import custom refactorings - either self- or 3rd-party built.
It’s still an experimental feature, so it needs to be switched on manually, but hopefully it can provide you some much neeeded productivity boost.
Let’s have a look at how that’s done.
Running multiple independent ASP.NET Core pipelines side by side in the same application
The other day I started looking into a problem of being able to run several independent ASP.NET Core pipelines from within the same main application, running on top of the same Kestrel server. This was actually asked on MVC Github repo but closed without a real answer.
Let’s have a detailed look at the problem, and (one) possible solution to it.
Disposing resources at the end of ASP.NET Core request
Today, let’s have a look at dealing with disposable objects in ASP.NET Core. Imagine you have an object that you’d like to reuse throughout the duration of the HTTP request, but at the end, it must clean up some of its open resources or handles. This is a common requirement for i.e. file writers, DB connections, other unmanaged resources or external processes - to mention just a few.
Building microservices with ASP.NET Core (without MVC)
There are several reasons why it makes sense to build super-lightweight HTTP services (or, despite all the baggage the word brings, “microservices”). I do not need to go into all the operational or architectural benefits of such approach to system development, as it has been discussed a lot elsewhere.
It feels natural that when building such HTTP services, it definitely makes sense to keep the footprint of the technology you chose as small as possible, not to mention the size of the codebase you should maintain long term.
In this point I wanted to show a couple of techniques for building very lightweight HTTP services on top ASP.NET Core, without the use of any framework, and with minimal code bloat.
C# code formatting settings in VS Code and OmniSharp
I quite often get or see questions about configuring C# code formatting settings for Visual Studio Code.
OmniSharp (the open source Roslyn-based technology that powers C# language services) in VS Code exposes a rich set of code formatting settings which you can use to tailor and customize your C# experience.
Let’s have a look at how you can use them.
Accessing HttpContext outside of framework components in ASP.NET Core
When developing web applications with ASP.NET, it is common to end up in situations where you require access to HttpContext. This wouldn’t be anything special, but outside of the context of framework level APIs such as controllers, middleware and so on (which would always give you a way to fetch the current HttpContext), it can be tricky.
While generally speaking, HttpContext could be passed around as a regular dependency to the logical components that require it, that solution is often impractical.
Let’s have a look at how you can get a hold of HttpContext in ASP.NET Core.
Writing C# build scripts with FAKE, OmniSharp and VS Code
In this blog post I’d like to show an extremely - in my opinion - productive way of writing build scripts using C#. As a basis, we’ll use the excellent core FAKE library called FakeLib, which is written F# and consume it in C# scripts.
Sure, there are other projects/task runners like Cake or Bau that allow you to write C# build scripts (few more actually out there) but the approach I’d like to show you today, is I think the most productive of all, so bear with me.
More after the jump.
Announcing ConfigR 1.0
Recently we released version 1.0 of ConfigR - a popular .NET configuration library, that lets you configure your application via C# scripts (CSX).
This is also the last release requiring full .NET 4.5/Mono - the next version of ConfigR is going to be a netstandard.
Here’s a overview of the features that are there in 1.0!
Lazy async initialization for expiring objects
Today I wanted to share something I found myself using quite a lot recently, and that is not supported out of the box by the .NET framework.
So, as part of the framework, we have Lazy
However, what if the object requires async operation to be created, and what if its value expires after some time, and it needs to be recomputed? Let’s have a look at how to solve this.
Introducing C# script runner for .NET Core and .NET CLI
In this post I wanted to share a little project I’ve been working on recently - a .NET CLI and .NET Core based script runner for C# (CSX scripts).
The idea was super simple - I just wanted to be able to author C# scripts using .NET Core, leverage project.json to define the script dependencies and execute scripts cross platfom using .NET CLI - via a dotnet script command.
The project is located here on Github. You can head over and have a look at readme to get started - but, briefly, the key features are listed here.
About

Hi! I'm Filip W., a software architect from Zürich 🇨🇭. I like Toronto Maple Leafs 🇨🇦, Rancid and quantum computing. Oh, and I love the Lowlands 🏴.
You can find me on Github, on Mastodon and on Bluesky.

Recent Posts
- 2025/03/10, Running Phi models on iOS with Apple MLX Framework
- 2025/02/24, Strathweb Phi Engine - now with Phi-4 support
- 2025/02/14, ML-KLEM and ML-DSA Post-Quantum Cryptography in .NET
- 2025/01/17, Fine tuning Phi models with MLX
- 2024/12/20, Running Phi Inference in .NET Applications with Strathweb Phi Engine
Categories
- ai (20)
- ai search (5)
- apache cordova (1)
- asp.net 5 (17)
- asp.net core (47)
- asp.net mvc (35)
- asp.net mvc 6 (7)
- asp.net vnext (6)
- asp.net web api (96)
- astronomy (1)
- autogen (1)
- azure (22)
- azure service bus (1)
- azure-devops (1)
- benchmark dotnet (1)
- bing maps (1)
- blazor (2)
- c plus (2)
- c-sharp (156)
- cryptography (6)
- csharp (6)
- csharp 10 (2)
- dnx (3)
- dotnet-cli (2)
- dotnet-script (11)
- duende (4)
- editorconfig (1)
- entity framework (2)
- espn api (2)
- events (1)
- ffi (4)
- fsharp (1)
- git (1)
- glimpse (1)
- html5 (4)
- identity server (2)
- iis (2)
- il (1)
- intro to qc (19)
- ios (7)
- javascript (9)
- jquery (4)
- jquery mobile metro (1)
- katana (2)
- kindle (1)
- knockout.js (8)
- kotlin (2)
- last.fm api (2)
- linq (1)
- mac (3)
- macos (1)
- mathematica (1)
- msbuild (3)
- mvc core (3)
- nancy (2)
- native (1)
- net (144)
- net 5 (3)
- net 6 (5)
- net 7 (7)
- net 8 (3)
- net 9 (1)
- net core (49)
- net sdk (2)
- ninject (2)
- odata (4)
- oidc (2)
- omnisharp (13)
- openai (11)
- osx (2)
- owin (5)
- phi (8)
- php (1)
- python (1)
- q-sharp (36)
- qir (3)
- qiskit (1)
- quantum computing (41)
- roslyn (30)
- rust (6)
- scriptcs (11)
- scripting (9)
- security (9)
- servicestack (2)
- signalr (8)
- swift (9)
- testing (5)
- twitter boostrap (1)
- typescript (1)
- visual studio (4)
- visual studio code (11)
- wasi (3)
- wasm (3)
- windows phone 7 (1)
- wordpress (1)
- wpf (2)