With the introduction of Visual Studio 2017, Microsoft added some optimizations to how a project file can be set up. However, no tooling was made available that performed this conversion as it was not necessary to do since Visual Studio 2017 would work with the old format too.
This project converts an existing csproj to the new format, shortening the project file and using all the nice new features that are part of Visual Studio 2017.
There are a number of things that VS2017 handles differently that are performed by this tool:
- Include files using a wildcard as opposed to specifying every single file
- A more succinct way of defining project references
- A more succinct way of handling NuGet package references
- Moving some of the attributes that used to be defined in AssemblyInfo.cs into the project file
- Defining the NuGet package definition as part of the project file
Using the tool is simple, it is a simple command line utility that has a single argument being the project file you would like to convert. You can also give a directory path and the tool will discover all csproj files nested in it.
For example
Project2015To2017.exe "D:\Path\To\My\TestProject.csproj"
Or
Project2015To2017.exe "D:\Path\To\My\Directory"
After confirming this is an old style project file, it will start performing the conversion. When it has gathered all the data it needs it first creates a backup of the old project file (suffixed with .old) and then generates a new project file in the new format.