stylecop

Can´t edit sourcecode in VS Texteditor when resharper is running

大憨熊 提交于 2019-12-10 15:04:02
问题 For some time I use Resharper in Visual Studio 12, but since a few days I have a problem. If Resharper running, I can not type anything in the source code editor in Visual Studio. I'm using the version 8.2.0.2160 and StyleCop version 4.7.49.0 All settings I have completely reset. I have also deleted the settings files. I have also uninstalled Resharper and StyleCop and reinstalled. Nothing helps! The strange thing is, that I (except C# and xaml) can probably edit in other files. Or when I

Specify path to CustomDictionary file for StyleCop spellchecking

扶醉桌前 提交于 2019-12-10 12:46:28
问题 Spell checking of the comments was added to the recent versions of StyleCop. It seems I can reuse my existing CustomDictionary file (that I created for FxCop) with StyleCop. SA1650 rule documentation does not say that it is possible. But in release notes for version 4.7.39 I see Add support for specifying dictionary folders in the settings.StyleCop file. How do I configure StyleCop to search for this file in the root folder of my solution? 回答1: In my case it worked when I specified the custom

How to suppress a StyleCop warning of entire namespace files

ⅰ亾dé卋堺 提交于 2019-12-10 00:58:49
问题 I'm using Style Cop version 4.7. Global suppression don't work for every member of selected namespace. I have two files in the same namespace (StyleCopSample.Test). When I set suppress message in the first file, messages are suppressing only for this file, but the second file still gets a warnings. Content of the first file: [assembly: SuppressMessage("CSharp.DocumentationRules", "*", Scope = "Namespace", Target = "StyleCopSample.Test")] namespace StyleCopSample.Test { class TestFirst {} }

Adding GNU GPL Licence to C# App [closed]

試著忘記壹切 提交于 2019-12-09 20:14:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I know how to do this but I don't know is the StyleCop method true/working. Normally in StyleCop rules you must add this thing like this example to header (need to edit): //----------------------------------------------------------------------- // <copyright file="Widget.cs" company="Sprocket Enterprises"> //

How to get Visual Studio quick comments to add a space after the double slash to avoid SA1005?

空扰寡人 提交于 2019-12-08 15:53:58
问题 In Visual Studio, I have a block of code. I highlight it and use Ctrl+k+c to comment out the block. That adds "//" at the start of every line I highlighted. I then try to submit my code... and I run into StyleCop rule "SA1005" that requires all // to be followed by a space or be changed to ////. I would really like to modify Visual Studio so that ctrl+k+c adds "// ". I have not found any extensions or options that make that happen. Does anyone know of a way to do that change (short of writing

Enabling StyleCop.Analyzers on ASP.NET Core projects

送分小仙女□ 提交于 2019-12-08 02:26:27
问题 According to the docs I've read online all you need to do is add the following to the dependencies in project.json: "version": "1.0.0-*", "dependencies": { "DependencyA": "1.0.0-*", "DependencyB": "1.0.0-*", "StyleCop.Analyzers": { "version": "1.0.0", "type": "build" } }, "frameworks": { "net46": { } } (where DependencyA and DependencyB are two .NET Core projects from the same solution) and then StyleCop.Analyzers will run with the default rule set upon building the project. It doesn't. I get

Using StyleCop in Asp.net Core

一个人想着一个人 提交于 2019-12-07 04:58:32
问题 According to this this article for using StyleCop in Asp.net Core, 1)Add the following to the dependencies section of the project.json file: "StyleCop.Analyzers": { "version": "1.0.0", "type": "build" } and build the project. 2) Create stylecop.json and add your configuration on it, this is my stylecop.json content: { "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": {

Is it possible to run StyleCop on just 1 file in a project?

和自甴很熟 提交于 2019-12-06 21:15:03
问题 Is it possible to run StyleCop on just 1 file in a project? 回答1: Yes, by selecting "Run StyleCop" from the context menu of the .cs file, not from the Tools menu or the project's context menu. http://cleartopartlycloudy.blogspot.com/2009/06/stylecop-with-single-file.html 来源: https://stackoverflow.com/questions/1887776/is-it-possible-to-run-stylecop-on-just-1-file-in-a-project

Visual Studio: temporarily disable StyleCop

跟風遠走 提交于 2019-12-06 18:40:34
问题 Can you disable styleCop in VS? Scenario: Press "Disable StyleCop" button Run/debug some test code The button automatically, enable StyleCop again. Therefore you have to actively disable it again it you want to run without StyleCop. 回答1: I've setup a separate build configuration that doesn't run code analysis. I now have the following configurations in VS: Release Debug Debug (No code analysis) You have to manually choose which configuration you want to build (i.e. step 3 in your list would

How do I set the ReSharper default Company and Copyright?

天涯浪子 提交于 2019-12-06 17:28:56
问题 I just installed Stylecop 4.5RC along with ReSharper. When I create a new class, I see that I am now compliant (yay!), but I want the company to be my company, not Microsoft. I also have too much to do to have to worry about updating the copyright text. How do I fill these in by default? // ----------------------------------------------------------------------- // <copyright file="ReaderResultTypes.cs" company="Microsoft"> // TODO: Update copyright text. // </copyright> // -------------------