{"id":21298814,"url":"https://github.com/litee/solutioncop","last_synced_at":"2025-07-11T18:32:50.298Z","repository":{"id":26302367,"uuid":"29750287","full_name":"Litee/SolutionCop","owner":"Litee","description":"Tool for static analysis of Visual Studio solutions","archived":false,"fork":false,"pushed_at":"2017-10-29T12:32:06.000Z","size":409,"stargazers_count":23,"open_issues_count":18,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-27T06:16:29.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Litee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-23T19:54:42.000Z","updated_at":"2020-11-15T03:21:23.000Z","dependencies_parsed_at":"2022-08-27T09:10:51.080Z","dependency_job_id":null,"html_url":"https://github.com/Litee/SolutionCop","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/Litee/SolutionCop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Litee%2FSolutionCop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Litee%2FSolutionCop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Litee%2FSolutionCop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Litee%2FSolutionCop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Litee","download_url":"https://codeload.github.com/Litee/SolutionCop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Litee%2FSolutionCop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264870700,"owners_count":23676290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T14:57:34.397Z","updated_at":"2025-07-11T18:32:49.966Z","avatar_url":"https://github.com/Litee.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SolutionCop and SolutionCop.MSBuild overview\n\nSolutionCop is a tool for analyzing Visual Studio solutions and projects. It covers the gap between [FxCop](https://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx) (static analysis of assemblies) and [StyleCop](http://stylecop.codeplex.com/) (static analysis of source code) and allows to do checks like lost files or unused NuGet packages. This tool is successfully used in several big .NET projects and saved me a lot of time. \n\nSolutionCop.MSBuild allows to run SolutionCop checks during project compilation and detect issues earlier.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/laycp76h8l738cdu/branch/master?svg=true)](https://ci.appveyor.com/project/Litee/solutioncop/branch/master)\n\n## Supported rules - see more details for each rule by clicking its name\n\n* Basic rules\n  * [TargetFrameworkVersion](https://github.com/Litee/SolutionCop/wiki/TargetFrameworkVersion)\n  * [TreatWarningsAsErrors](https://github.com/Litee/SolutionCop/wiki/TreatWarningsAsErrors)\n  * [SuppressWarnings](https://github.com/Litee/SolutionCop/wiki/SuppressWarnings)\n  * [WarningLevel](https://github.com/Litee/SolutionCop/wiki/WarningLevel)\n  * [FilesIncludedIntoProject](https://github.com/Litee/SolutionCop/wiki/FilesIncludedIntoProject) - useful rule for finding files lost during refactoring - either files that are not required anymore, but were not deleted or unit tests which are not tracked anymore.\n  * [TargetFrameworkProfile](https://github.com/Litee/SolutionCop/wiki/TargetFrameworkProfile)\n  * [SameNameForAssemblyAndRootNamespace](https://github.com/Litee/SolutionCop/wiki/SameNameForAssemblyAndRootNamespace)\n* NuGet-related rules\n  * [NuGetAutomaticPackagesRestore](https://github.com/Litee/SolutionCop/wiki/NuGetAutomaticPackagesRestore)\n  * [NuGetPackagesUsage](https://github.com/Litee/SolutionCop/wiki/NuGetPackagesUsage)\n  * [ReferenceNuGetPackagesOnly](https://github.com/Litee/SolutionCop/wiki/ReferenceNuGetPackagesOnly) - very useful to detect when reference switches from NuGet binary to raw binaries in Bin/Debug. Hard to notice, but may cause weird hard-to-understand side effects.\n  * [NuGetPackageVersions](https://github.com/Litee/SolutionCop/wiki/NuGetPackageVersions) - super-useful if you have large project or set of projects and want to control all changes for external dependencies - here all dependencies and versions will be in a single file, which helps a lot.\n  * [SameNuGetPackageVersions](https://github.com/Litee/SolutionCop/wiki/SameNuGetPackageVersions) - one more useful rule to avoid partial NuGet upgrades when only some projects were upgraded. It may also cause strange side effects.  \n  * [NuspecHasTheSameVersionsWithPackagesConfig](https://github.com/Litee/SolutionCop/wiki/NuspecHasTheSameVersionsWithPackagesConfig) - checks, that nuspec file has the same version dependencies with solution's packages\n  * [NuGetMandatoryPackage](https://github.com/Litee/SolutionCop/wiki/NuGetMandatoryPackage) - checks that all projects use specific package - e.g. mandatory pack of code analyzers\n* StyleCop-related rules\n  * [StyleCopEnabled](https://github.com/Litee/SolutionCop/wiki/StyleCopEnabled)\n  * [TreatStyleCopWarningsAsErrors](https://github.com/Litee/SolutionCop/wiki/TreatStyleCopWarningsAsErrors)\n\n## How to use SolutionCop\n\n1. Install SolutionCop via command line `NuGet.exe Install SolutionCop` or (for brave ones) via `NuGet.exe Install SolutionCop -Prerelease`. \n2. Launch SolutionCop once in command line: `SolutionCop.exe -s MySolution.sln` it will automatically create *SolutionCop.xml* file next to *MySolution.sln*. All rules in this config file will be disabled. Now you can enable rules in config file and launch SolutionCop checks: \n\n```PowerShell\nSolutionCop.exe -s MySolution.sln -c SolutionCop.xml [-b TeamCity] [--build-server-no-success-messages]\n```\n\nI recommend to enabled rules gradually, especially if you have large project.\n\n## How to use SolutionCop.MSBuild\n\n1. Install SolutionCop (see instruction above) and generate rules for your solution \n2. Install **SolutionCop.MSBuild** NuGet package into every VS project you want to check and watch for errors in build output. Some notes:\n * SolutionCop.MSBuild doesn't allow to specify path to config file - instead it looks for *SolutionCop.xml* file in parent folders starting with folder where .csproj file is defined. Once config file is found logic is the same as in SolutionCop.\n * SameNuGetPackageVersions rule won't work in SolutionCop.MSBuild because tool processes each project separately, so has no chance to compare package versions between different projects.\n * To see more detailed output select verbose MSBuild output level in VS settings\n\n## TODO - Rules (in priority order)\n* Check for \"Copy Local\" used\n* Classify project by type (e.g. production, testing) and disallow references between some project types\n* Proper owner in AssemblyInfo (can it be done via FxCop?)\n* Proper copyright date in AssemblyInfo (can it be done via FxCop?)\n\n## TODO - Other\n* Option to fail on missing sections instead of creating them\n* Provide links to rule details in output\n* Move error messages to resources","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitee%2Fsolutioncop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitee%2Fsolutioncop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitee%2Fsolutioncop/lists"}