Visualstudio-docs: Code Analysis Dictionary .NET Core 2 support

Created on 31 Dec 2017  Â·  8Comments  Â·  Source: MicrosoftDocs/visualstudio-docs

Seems like .NET Core 2 doesn't have "CodeAnalysisDictionary" build action at all. Do you have any plans to support it?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 5c0c5937-e895-d2e3-0e14-655cf4e52d6a
  • Version Independent ID: abe9dea4-c830-c476-1e9d-fd2386d014c3
  • Content
  • Content Source
product-feedback vs-ide-code-analysitech

Most helpful comment

This issue should remain open until a solution has been implemented.

All 8 comments

@ignas-sakalauskas You are correct. Binary FxCop rules support customizing naming rules with a custom supplied dictionary, but .NET Core projects don't support binary code analysis. You can use the Roslyn analyzers on .NET Core projects, however as of yet, no naming rules have been ported over from FxCop to the Roslyn analyzers. We do hope to add some naming rules to the Roslyn analyzers soon.

@gewarren Did you close the ticket because you have solution? Can you share it?

@BorisBoyko Currently there is no support for custom code analysis dictionaries in .NET Core projects. There is work planned to port some of the code analysis naming rules from FxCop to Roslyn analyzers, so once that happens you'll be able to create a custom dictionary.

This issue should remain open until a solution has been implemented.

@SeanHogg You can log an issue over at the Roslyn issues page, although they may already be tracking this work to port the naming rules to FxCop Roslyn analyzers. There is no plan to add support to binary FxCop analysis for .NET Core projects as far as I am aware.

@gewarren Not sure how to ask the question, or make a statement. .Net Standard projects which consume the stylecop.analyzers can customize the rules via adding a XXX.stylecop configuration/rule file. Since .net standard projects and the latest nuget/nuspec configuration doesn't allow external files to be added. However, based upon this documentation we can add linked files (in this example: added 'stylecop.json' file as a linked file.
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md

This is great b/c we can distribute the stylecop.json file as part of the nuget and then include it as a linked file.

My question/Statement is, when i try to add the xxx.stylecop file as a link it doesn't recognize the rules. The file has to exist in the physical directory unlike the .json settings file.

@SeanHogg Sorry to keep sending you off to other issues pages, but I think this is more a question for the StyleCopyAnalyzers repo. Here's the issues page for that: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ogglas picture Ogglas  Â·  3Comments

rlundy picture rlundy  Â·  3Comments

CeciAc picture CeciAc  Â·  3Comments

H35am picture H35am  Â·  4Comments

nitinjs picture nitinjs  Â·  3Comments