Colleagues, have a nice day!

There is a healthy solution (.sln) in which new projects (.csproj) are constantly being added. It is necessary to monitor their settings and automatically adjust.

In our case, these are the code analysis parameters that need to be redefined by adding the corresponding parameters to the base section, and removing the extra ones from the platform-specific ones.

How to do it?

Extensions for the studio are considered last.

  • What is the базовая секция ? - UserName

1 answer 1

You can use Directory.Build.prop , which will be automatically imported into projects:

Microsoft.Common.props and properties later are unavailable to it. So, you can’t get it.

as well as Directory.Build.targets :

Directory.Build.targets is imported from Microsoft.Common.targets after importing .targets files from NuGet packages. So you can need it after the final import.


This refers to the build process. If you need to change files, then you can not do without extensions, you can implement a custom project template.


Customize your build