You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a sample .NET Core project (a class library targeting netstandard2.0) to try StyleCopAnalyzers, and I intentionally made some violations in the code.
I added a reference to StyleCopAnalyzers, and I immediately can see the warnings on build:
dotnet build
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 33.55 ms for C:\Workspaces\Github\CodeStyleCheckSample\src\CodeStyleCheckSample\CodeStyleCheckSample.csproj.
MyClass.cs(27,18): warning SA1402: File may only contain a single class [C:\Workspaces\Github\CodeStyleCheckSample\src\CodeStyleCheckSample\CodeStyleCheckSample.csproj]
MyClass.cs(1,1): warning SA1633: The file header is missing or not located at the top of the file. [C:\Workspaces\Github\CodeStyleCheckSample\src\CodeStyleCheckSample\CodeStyleCheckSample.csproj]
...
Or, if I add the <TreatWarningsAsErrors>true</TreatWarningsAsErrors> flag to the csproj, then they show up as Errors.
If I open the solution in Visual Studio, I can nicely see the warnings or errors show up as squigglies.
But if I try it in Visual Studio Code, then I don't see any of these, regardless of whether I set TreatWarningsAsErrors to true or not.
On the other hand, if I make an actual syntax error, that immediately shows up, so the C# integration itself is working properly.
Do you know what I might be doing wrong, or what setting I should change to make the analyzer errors show up in VSCode?
The text was updated successfully, but these errors were encountered:
I created a sample .NET Core project (a class library targeting
netstandard2.0
) to try StyleCopAnalyzers, and I intentionally made some violations in the code.I added a reference to StyleCopAnalyzers, and I immediately can see the warnings on build:
Or, if I add the
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
flag to the csproj, then they show up as Errors.If I open the solution in Visual Studio, I can nicely see the warnings or errors show up as squigglies.
But if I try it in Visual Studio Code, then I don't see any of these, regardless of whether I set
TreatWarningsAsErrors
to true or not.On the other hand, if I make an actual syntax error, that immediately shows up, so the C# integration itself is working properly.
Do you know what I might be doing wrong, or what setting I should change to make the analyzer errors show up in VSCode?
The text was updated successfully, but these errors were encountered: