Welcome to the Update CS Project repository.
Update CS Project allows batch updates to C# project files.
There are a few main use cases, that all work in batch mode so you can update 100s of project files in one go
- Adding a code analyzer, that performs static code analysis checks on a project
- Updating a code analyzer to the latest version
- Generating a GlobalSuppressions file. This may be required after introducing or updating an analyzer, since that may lead to 100s or 1000s of violations that break the build and cannot be addressed immediately.
Using this tool ensures consistency in enterprise archives, without the need for active checking / gating.
This repository is under Active development and used to maintain an enterprise archive with over 250 csproj files.
- Ensure this project is built (see below)
- Ensure your projects are fully built
- Add the FxCop analyzers with the command
UpdateCsProject.exe . --addanalyzer Microsoft.CodeAnalysis.NetAnalyzers 6.0.0
- Please build your projects. Most likely it will fail to compile, because the analyzers flag issues
- Add the GlobalSuppressions with the command
UpdateCsProject.exe . --suppress
Update CS Project provides a extensible mechanism, which can be configured with the following command line options:
Command switch | Description |
---|---|
--addanalyzer | Add a given analyzer to the references |
--suppress | Suppress all existing Code Analyzer errors in the GlobalSuppressions.cs file. |
--updateinvalidsuppressionpath | Delete or moves the GlobalSuppressions file from Properties folder to the root. |
--removeproperty | Remove the specified property. |
- Ensure you have a recent version of Visual Studio
dotnet build Source\UpdateCSProject.sln
- The path to the executable is: 'Source\UpdateCSProject\bin\debug\net472\UpdateCsProject.exe'
This project is maintained by (in alphabetical order):
- Akshat Agrawal
- Mark Venbrux
- Kiran Ramaiah
- Jan Zwanenburg
- Paul de Feyter
- Vishal Srivastava
- Ynse Hoornenborg
This project uses the CODE_OF_CONDUCT to define expected conduct in our community. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project CODEOWNER
See CONTRIBUTING
See LICENSE