Fridathon: unstructured learning or hacking you can opt-in to do on any random Friday.

Authoring IDE-only tests

API exploration, whether third party or your own, is a necessary and unavoidable part of regular development. There are many mechanisms available today for doing such exploration in a one-time, throw-away style, but it might be worth considering keeping those explorations around in your code base and even make them easily executable within the IDE afterwards, for further learning or other team members’ benefit. [Read More]
Tags: dotnet testing

NuGetizer as an alternative to .NET SDK Pack

There is a very long standing feature request for NuGet Pack to “allow project reference DLLs to be added to the parent nupkg for pack target like IncludeReferencedProjects in nuget.exe”. This has been going on for years (5 almost as of 2021) and has had over 260 comments so far. Seems like quite the significant pain point for some customers. [Read More]
Tags: nuget sdk dotnet

Shareable Windows Terminal profile for installed Visual Studio Developer PowerShell

As I mentioned in another post, Visual Studio now provides a Developer PowerShell command prompt shortcut, which is super useful since it has all the environment variables properly set up to do things like msbuild from command line and have it pick the “right” MSBuild, as well as launching VS by just typing devenv. There is a not-so-minor drawback to these shortcuts though: they hardcode the VS installation ID, so just copy/pasting the command line in your Windows Terminal profile won’t roam nicely across machines: [Read More]
Tags: code

How use Visual Studio, MSBuild or Roslyn previews in GitHub or DevOps CI

If you want to leverage the many awesome C# 9 features, including roslyn source generators like ThisAssembly, all of which require the latest and greatest .NET 5.0 preview, it would be a pity to have to give up the safety net of your CI builds (whether GitHub Workflows or Azure DevOps pipelines) just because they don’t provide hosted images with the relevant bits. [Read More]

How to generate code using Roslyn source generators in real world scenarios

Roslyn (as of 16.8 Preview 3) now brings first-class support for source code generators that run as part of a project compilation. The provided cookbook is a fantastic resource to get to know the capabilities and some specific scenarios this feature was created for. The carefully chosen set of features, driven by concrete scenarios, make for a powerful and flexible toolset to supercharge your nuget packages with. In this blog post I’ll outline how I’m using it, in light of my first real-world use case: ThisAssembly. [Read More]
Tags: roslyn codegen

On Messaging as Extensibility API

Back in 2012, I was on a CQRS Journey together with the fine team at Microsoft patterns & practices. We had a great advisory board to discuss and learn from and it was an interesting way to tackle a novel pattern to solve a complex problem. Back then microservices wasn’t even a thing yet, go figure! [Read More]
Tags: code patterns