Skip to content

Commit

Permalink
Updated docs and build number for v2.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
realvizu committed Jun 13, 2021
1 parent a256f0d commit 225ca30
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 221 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# NsDepCop Change Log

## v2.0.0
(06/2021)

The big change in this version is that the implementation changed from MSBuild task + Visual Studio Extension to a standard Roslyn analyzer.

- [x] NsDepCop must be added to a project as a NuGet package.
- [x] Appears in Solution Explorer: project / Dependencies / Analyzers / NsDepCop.Analyzer
- [x] Issue severities can be configured that same way as other analyzers (use Visual Studio or .editorconfig files).
- [x] Works both at build time and inside Visual Studio editor.
- [x] Requires Visual Studio 2019 (16.10.0 or later).
- [x] Supports .NET Core / .NET 5 / etc. projects too.
- [x] Uses Roslyn 3.9.0.

Stuff that was removed:
- [x] No need for the NsDepCop Visual Studio Extension any more.
- [x] No need for the out-of-process service host any more.
- [x] Dropped support for VS 2015/2017. For those, use NsDepCop v1.11.0.
- [x] Config attributes no longer supported (ignored): CodeIssueKind, MaxIssueCountSeverity, InfoImportance, AnalyzerServiceCallRetryTimeSpans.

Other info:
- [x] AutoLowerMaxIssueCount feature is temporarily not supported.

## v1.11.0
(04/2020)

Expand Down
36 changes: 5 additions & 31 deletions Contribute.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
# How to Contribute to NsDepCop
* [How to build the source](#how-to-build-the-source)
* [How to debug the tool in Visual Studio 2017](#how-to-debug-the-tool-in-visual-studio-2017)
* [How to debug the tool in Visual Studio 2015](#how-to-debug-the-tool-in-visual-studio-2015)
* [Why have different VSIX for VS2015 and VS2017?](#why-have-different-vsix-for-vs2015-and-vs2017)

## How to build the source
1. Prerequisites
* Visual Studio 2017/2019 (any edition)
* Visual Studio 2019 (16.10.0 or later, any edition)
* With workload: **Visual Studio extension development**
1. [Download or clone the source](https://github.com/realvizu/NsDepCop)
1. Open "source\NsDepCop.sln"
1. Build the solution.

## How to debug the tool in Visual Studio 2017
1. Set **NsDepCop.VisualStudioIntegration.Vs2017** as the StartUp project.
1. In the project properties set up the debug start action.
* **Start external program**: the path to VS2017 devenv.exe
* E.g.: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
* **Command line arguments**: /rootsuffix Exp
1. Run the solution.

## How to debug the tool in Visual Studio 2015
1. Set **NsDepCop.VisualStudioIntegration.Vs2015** as the StartUp project.
1. In the project properties set up the debug start action.
* **Start external program**: the path to VS2015 devenv.exe
* E.g.: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
* **Command line arguments**: /rootsuffix Roslyn
1. Run the solution.

## Why have different VSIX for VS2015 and VS2017?
Because they are built with different Roslyn version.
* VS2015 uses Roslyn 1.x.x (C# 6.0)
* VS2017 uses Roslyn 2.x.x (C# 7.x)

See:
* https://docs.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support
* https://github.com/dotnet/roslyn/wiki/NuGet-packages
## How to debug the tool in Visual Studio
1. Set **NsDepCop.Vsix** as the StartUp project.
1. In the project file modify the **StartArguments** tag to point to a valid solution file and log path.
1. Run the solution.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,33 @@ What is this [**dependency control**](doc/DependencyControl.md) anyway?

1. Add the **NsDepCop NuGet package** to your C# projects: [![NuGet Package](https://img.shields.io/nuget/v/NsDepCop.svg)](https://nuget.org/packages/NsDepCop)
1. Add a file called **config.nsdepcop**. Edit it and describe [**dependency rules**](doc/Help.md#dependency-rules).
* For projects that use the old packages.config nuget format the file is automatically added.
1. When you **build** the project, dependency violations will be reported in the build output just like compiler errors/warnings.
1. Dependency violations will be underlined in the code editor and also reported at build time just like compiler errors/warnings.

See the [**Help**](doc/Help.md) for details.

## Optional Stuff

* Install the **VSIX** (Visual Studio Extension) to get **instant** dependency check while editing the code.
* For Visual Studio 2017/2019: [![Visual Studio extension](https://img.shields.io/badge/Visual%20Studio%20Marketplace-NsDepCop-green.svg)](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.NsDepCopVS2017-CodedependencycheckerforC)
* For Visual Studio 2015: [![Visual Studio extension](https://img.shields.io/badge/Visual%20Studio%20Marketplace-NsDepCop%20VS2015-green.svg)](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.NsDepCop-NamespacedependencycheckertoolforC)

* Install the **NsDepCop Config XML Schema Support** for Visual Studio to get validation and IntelliSense while editing the config.nsdepcop files.
* For Visual Studio 2017/2019: [![Visual Studio extension](https://img.shields.io/badge/Visual%20Studio%20Marketplace-NsDepCop%20Config%20XML%20Schema%20Support-green.svg)](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.NsDepCopConfigXMLSchemaSupport)
* For Visual Studio 2015: see the instructions in [Help](doc/Help.md#config-xml-schema-support-in-visual-studio).

## Changes in v2.0

The big change in v2.0 is that the implementation changed from MSBuild task + Visual Studio Extension to a standard Roslyn analyzer.
- **Supports .NET Core / .NET 5** projects too.
- **No need for the NsDepCop Visual Studio Extension** any more.
- The NuGet package works both at build time and inside Visual Studio editor.
- If the NuGet package is added to a project then it appears in Solution Explorer: project / Dependencies / Analyzers / NsDepCop.Analyzer
- [Issue severities can be configured using Visual Studio light bulb menu or .editorconfig files](https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019).
- **Requires Visual Studio 2019 (16.10.0 or later).**
- Dropped support for VS 2015/2017. For those, use NsDepCop v1.11.0.
- No need for the out-of-process service host any more.
- No more "Unable to communicate with NsDepCop service".

Please note that the AutoLowerMaxIssueCount feature is temporarily not supported. Do not yet upgrade to v2.0 if you're using that.

## Versions
* See the [**Change Log**](CHANGELOG.md) for version history.
* See the [**Upgrade instructions**](CHANGELOG.md#upgrading) if upgrading from versions prior to v1.6.0.
* See the [**Milestones**](https://github.com/realvizu/NsDepCop/milestones) for planned releases.

## Feedback
* Please use the [**Issue Tracker**](https://github.com/realvizu/NsDepCop/issues) to record bugs and feature requests.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ image: Visual Studio 2019

environment:
shortversion: '2.0.0'
informationalversion: '2.0.0-rc1'
informationalversion: '2.0.0'

version: '$(shortversion).{build}'

Expand Down
34 changes: 17 additions & 17 deletions doc/Diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@

Title|Illegal namespace reference.
:-|:-
Severity|Set by CodeIssueKind attribute in the config file. (Default: Warning)
Explanation|The designated symbol in the source code implies a namespace reference which is not allowed by the current namespace dependency configuration. That is, the symbol is used in a type in namespace A and references a type in namespace B but A->B dependency is not allowed.
To Do|Change the namespace dependency configuration in the config.nsdepcop file or change your code/design to avoid this namespace reference.
Default Severity|Warning
Explanation|The designated type cannot reference the other type because their namespaces cannot depend on each other according to the current rules.
To Do|Change the dependency rules in the 'config.nsdepcop' file or change your design to avoid this namespace dependency.

### NSDEPCOP02

Title|Too many issues, analysis was stopped.
Title|Too many dependency issues, analysis was stopped.
:-|:-
Severity|Warning
Explanation|The analysis stops after reporting a certain number of issues (default: 100) to avoid flooding your build log.
To Do|Correct the reported issues and run the build again. Or set the MaxIssueCount attribute in your config.nsdepcop to a higher number.
Default Severity|Warning
Explanation|The number of dependency issues in this compilation has exceeded the configured maximum value.
To Do|Correct the reported issues and run the build again or set the MaxIssueCount attribute in your 'config.nsdepcop' file to a higher number.

### NSDEPCOP03

Title|No config file found, analysis skipped.
:-|:-
Severity|Info
Explanation|If there's no config.nsdepcop file next to the C# project file then NsDepCop does not perform analysis.
Default Severity|Info
Explanation|This analyzer requires that you add a file called 'config.nsdepcop' to your project with build action 'C# analyzer additional file'.
To Do|None, this is just an informational message.

### NSDEPCOP04

Title|Analysis is disabled in the nsdepcop config file.
Title|Analysis is disabled in the config file.
:-|:-
Severity|Info
Explanation|There is a config.nsdepcop file next to the C# project file, but it contains IsEnabled="False".
Default Severity|Info
Explanation|The IsEnabled attribute was set to false in this project's 'config.nsdepcop' file, so the analyzer skips this project.
To Do|None, this is just an informational message.

### NSDEPCOP05

Title|Error loading NsDepCop config.
Title|Error loading config.
:-|:-
Severity|Error
Explanation|There was an error while loading the config.nsdepcop file. Some possible reasons: malformed content, file permission or locking problem. The diagnostic contains the actual exception message.
Default Severity|Error
Explanation|There was an error while loading the 'config.nsdepcop' file, see the message for details. Some common reasons: malformed content, file permission or file locking problem.
To Do|Make sure that the file can be read by the user running the build or Visual Studio and make sure that its content is correct.

### NSDEPCOP06

Title|Analysis is disabled with environment variable.
:-|:-
Severity|Info
Explanation|If environment variable DisableNsDepCop is set to True or 1 then analysis is skipped.
Default Severity|Info
Explanation|If the 'DisableNsDepCop' environment variable is set to 'True' or '1' then all analysis is skipped.
To Do|None, this is just an informational message.
Loading

0 comments on commit 225ca30

Please sign in to comment.