Instantiating an object without using its constructor in C#
In this blog post we will look at how you could create an instance of an object in C# without calling its constructor - which sounds a bit crazy, but is actually something that has been supported by both CLR and Core CLR for a long time now.
More after the jump.
dotnet-script 0.50 is out – with support for .NET Core 3.0!
We have some exciting news to announce - dotnet-script is now supporting .NET Core 3.0.
We released the new version 0.50.0, with .NET Core 3.0 support already on September 25th, two days after .NET Core 3.0 went RTM, but kept quiet about it. The reason was that a large part of the scripting experience is the tooling in OmniSharp and the C# Extension for VS Code, and that had to be updated accordingly too.
“Implementing” a non-public interface in .NET Core with DispatchProxy
Reflection is a tremendously powerful concept in .NET, which every C# developer, sooner or later, ends up working with. It is very useful for a lot of perfectly honest scenarios such as for example assembly scanning, type discovery or all kinds of application composability features.
However, it can also be used to circumvent the public API surface of the dependencies you consume - to modify them or gain access to things that the author of your dependency didn’t exactly envision. That said, this process of “hacking around” is very typical for C# development world and, albeit somewhat risky, it sometimes might be the only way out of a coding jam you are in.
Things start to get interesting if you are forced to implement a non-public (for example internal) interface. At that point, the “basic” reflection can’t help anymore, so let’s have a look at how we can do it.
Dynamic controller routing in ASP.NET Core 3.0
One of the great extensibility points in the routing feature of the older versions of the ASP.NET MVC and ASP.NET Core MVC frameworks was the ability to pick up any route and dynamically point it at a given controller/action.
This had a lot of excellent use cases - as we will briefly see - and since ASP.NET Core 3.0 Preview 7, the feature is actually finally available in ASP.NET Core 3.0 (despite not being mentioned in the official release blog post).
So, let’s have a look at dynamic routing in ASP.NET Core 3.0 together!
EditorConfig support in OmniSharp and C# extension VS Code
Recently, I blogged about Roslyn analyzers support in OmniSharp and C# extension VS Code and some background on how that feature came together.
Today I am pleased to announce that in the latest OmniSharp release - 1.33.0, where we have shipped another large feature (in fact, the 2nd most requested feature in OmniSharp repo, after, well, analyzers) and that is support for EditorConfig.
Between then, and the time it took me to finally write this post, we actually have 1.34.0 which is even better - and is in fact included in the corresponding release 1.21.0 of the C# extension for VS Code.
More after the jump.
Building a C# Interactive shell in a browser with Blazor (WebAssembly) and Roslyn
In this post I wanted to show you how to write and embed a C# interactive shell (a REPL - read-evaluate-print-loop) in a browser, on top of WebAssembly.
The REPL will give you fully fledged C# interactive development playground, while still being completely sandboxed in the browser environment. I originally wrote this example for my session at Dotnet Cologne on May 10 this year.
More after the jump.
Reactive Azure Service Bus messaging with Azure Event Grid
Roslyn analyzers and code fixes in OmniSharp and VS Code
Recently we merged a big (albeit still experimental) feature into OmniSharp - the support for Roslyn analyzers.
I wanted to take a few moments today to discuss this feature with you, share some background info, show you how to get it enabled and share some plans for the next steps.
Elegant way of producing HTTP responses in ASP.NET Core outside of MVC controllers
ASP.NET Core 2.1 introduced support for a little (or, should I say, not at all) documented feature called IActionResultExecutor
Kristian has a great blog post about result executors, that I recommend you check out. From my side, I wanted to show you today a set of extension methods that were recently introduced into WebApiContrib.Core that make working with IActionResultExecutor
Be careful when manually handling JSON requests in ASP.NET Core
The other day I was reviewing some code in an ASP.NET Core app. It was an HTTP endpoint, written as a simple, lightweight middleware component (so no MVC), that was handling incoming JSON requests.
The endpoint was intended to act as an ingestion point for larger amounts of data, so by definition it was supposed to perform well. I immediately noticed a few things that raised my eyebrow, that I wanted to share with you today.
About
Hi! I'm Filip W., a cloud architect from Zürich 🇨🇭. I like Toronto Maple Leafs 🇨🇦, Rancid and quantum computing. Oh, and I love the Lowlands 🏴.
Recent Posts
- 2024/11/15, Strathweb Phi Engine - now with Safe Tensors support
- 2024/10/25, How GPT-4o-mini can be simultaneously 20x cheaper and 2x more expensive than GPT-4o
- 2024/10/14, Speech-based retrieval augmented generation (RAG) with GPT-4o Realtime API
- 2024/09/06, Using Local Phi-3 Models in AutoGen with Strathweb Phi Engine
- 2024/08/30, Building a chat app with Blazor WASM, SignalR and post-quantum end-to-end encryption
Categories
- ai (15)
- 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 (21)
- azure service bus (1)
- azure-devops (1)
- benchmark dotnet (1)
- bing maps (1)
- blazor (2)
- c plus (2)
- c-sharp (155)
- cryptography (5)
- csharp (5)
- 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 (5)
- javascript (9)
- jquery (4)
- jquery mobile metro (1)
- katana (2)
- kindle (1)
- knockout.js (8)
- kotlin (2)
- last.fm api (2)
- linq (1)
- mac (2)
- macos (1)
- mathematica (1)
- msbuild (3)
- mvc core (3)
- nancy (2)
- native (1)
- net (141)
- 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 (4)
- php (1)
- q-sharp (34)
- qir (3)
- quantum computing (38)
- roslyn (30)
- rust (5)
- scriptcs (11)
- scripting (9)
- security (8)
- servicestack (2)
- signalr (8)
- swift (8)
- 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)