Skip to content

Commit 0381278

Browse files
authored
Merge pull request #2311 from nover/master
Update DotNetCli.md with VS2017 instructions
2 parents 6e957c7 + b4412c7 commit 0381278

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

documentation/DotNetCli.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ For this add the following to the dependencies section of the project.json file:
1313
"type": "build"
1414
}
1515
```
16-
16+
For VS2017 / dotnet core 1.1.1 SDK 1.0.1 projects edit the `.csproj` file and mark the `StyleCop.Analyzers` as `PrivateAssets`:
17+
```xml
18+
<ItemGroup>
19+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta001" PrivateAssets="All" />
20+
</ItemGroup>
21+
```
1722
If the project is restored and built right now this will already run the analyzers. A few extra steps are needed if they should be configured.
1823

1924
## Rulesets and stylecop.json
@@ -25,6 +30,17 @@ To supply a ruleset file and a stylecop.json configuration file to the compiler
2530

2631
**Note: ** `additionalArguments` is not currently defined in the schema but does exist and is passed during the build
2732

33+
On VS VS2017 / dotnet core 1.1.1 SDK 1.0.1 projects update `.csproj` as follows to apply settings and custom rules:
34+
```xml
35+
<PropertyGroup>
36+
...
37+
<CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<AdditionalFiles Include="stylecop.json" />
41+
</ItemGroup>
42+
```
43+
2844
## Enabling xml documentation processing
2945

3046
All analyzers regarding xml documentation can only run if the xml processing is enabled. To do this add
@@ -34,3 +50,11 @@ All analyzers regarding xml documentation can only run if the xml processing is
3450

3551
to the `buildOptions` node of the project.json file. Note that this might cause additional CS1591 diagnostics to appear by the compiler.
3652
They can be suppressed in the ruleset file if necessary.
53+
54+
For VS VS2017 / dotnet core 1.1.1 SDK 1.0.1 projects update `.csproj`
55+
```xml
56+
<PropertyGroup>
57+
...
58+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
59+
</PropertyGroup>
60+
```

0 commit comments

Comments
 (0)