Skip to content

Sven Hübner IT

  • Home
  • Blog

Blog

  • Home
  • Blog

Gotcha with .globalconfig and Visual Studio

Posted by By sven.huebner.it April 1, 2023Posted inBuild, General Development
VS will always apply a `.globalconfig`, not just when analyzers are activated like the CLI build does. Use a different name and explicit inclusion to get consistent behavior.
Read More

Fun with generics: mapping a generic instance from a non-generic reference

Posted by By sven.huebner.it March 5, 2023Posted inGeneral Development
DDD can lead to dealing with non-generic references to generic instances of types. Generically mapping these instances or generically calling code with them is not straightforward. I present how it can nonetheless be unobtrusively achieved with a general visitor-like pattern.
Read More

Advanced MSBuild: Auto-setup test projects

Posted by By sven.huebner.it December 24, 2022Posted inBuild, General Development
You can minimize the effort of creating new test projects according to your project's conventions by defining some global default MSBuild properties. A new test project csproj will then be a five-liner consisting only of the SDK and TFM.
Read More

Advanced MSBuild: The Right Way™ of writing .props files

Posted by By sven.huebner.it December 18, 2022Posted inBuild, General Development1 Comment
Following a couple of simple rules will give you robust project/props/targets files that will just work.
Read More

Dealing with unnecessary bitness in 3rd party assemblies

Posted by By sven.huebner.it December 10, 2022Posted inBuild, General Development
If 3rd party assemblies unnecessarily target an inconvenient bitness, either convince the 3rd party of AnyCpu or force AnyCpu on the assembly yourself (with permission from legal).
Read More

Advanced MSBuild: Adding a ProjectReference sibling project to a PackageReference project

Posted by By sven.huebner.it December 3, 2022Posted inBuild, General Development1 Comment
Speed up development of dependent nuget package chains by creating sibling projects that use ProjectReference instead of PackageReference for instantaneous feedback.
Read More

Advanced MSBuild: project file as single source of truth for build and runtime

Posted by By sven.huebner.it November 19, 2022Posted inBuild, General Development
It is possible to define build parameters in a way that is accessible at runtime by declaring custom AssemblyAttribute entries in your csproj file.
Read More

Fun with generics: building a generic call without reflection

Posted by By sven.huebner.it November 12, 2022Posted inGeneral Development
DDD can lead to generic types that are hard to import to. This technique can be used to make a generic call with multiple type arguments when each type argument is supplied individually, e. g. from an import into a domain model.
Read More

Advanced MSBuild: multi-API-version compatibility without code duplication

Posted by By sven.huebner.it November 5, 2022Posted inBuild, General Development
Maintain functionality against different versions of an external library without code duplication by using preprocessor directives.
Read More

Advanced MSBuild: changing the build output directory, completely

Posted by By sven.huebner.it October 29, 2022Posted inBuild
To fully change the build output folder of a project, you need to redefine three project properties.
Read More

Posts pagination

1 2 3 … 5 Next page
Copyright 2025 — Sven Hübner IT. All rights reserved. Sinatra WordPress Theme
Scroll to Top