Moving to SDK-Style projects and package references in Visual Studio, part 2

November 4, 2019

The SDK style projects are the new form that first appeared for .net core, but actually can be used also for nearly any type of projects in the .net world. The old style, or what we could call legacy style, is a very complex style, and it is not uncommon to be the cause of merging issues, and also can cause all sorts of weird behavior. Both styles for a C# project has the extension csproj, even if their content is so different.

Whenever you have a new project, you should go for the SDK style. There are a few projects types that still have to use the legacy format, WPF applications being one.

The SDK format can also be opened as text in Visual Studio without unloading the project first. This makes it much more easy to maintain the project file.

Legacy projects can be converted to the new style project form. You can do this manually, which I will cover in an upcoming post. In this post I will show a neat tool which can convert a whole solution, and also have capabilities to optimize the new style. Even after this conversion there are further optimizations you can do, to trim down the file.

Terje has written more about this topic in his personal blog. For the entire blog post, take a look here.