Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Code Style "Errors" do not prevent build?

I've set various C# Code Style rules to generate errors, and while violations show up as errors in the IDE (both in the error list and the text editor), actual builds still succeed.

Can anyone confirm this? I've tested on VisualStudio/15.0.0+26228.9 under both the Community (at home) and Enterprise (at work) editions. And I can't get any build to break due to a code style violation.

I've even tried to use .editorconfig, and builds still go through...

like image 447
Xorcist Avatar asked Mar 24 '17 16:03

Xorcist


People also ask

How do I ignore build errors in Visual Studio?

Suppress specific warnings for Visual C# or F# Or, select the project node and press Alt+Enter. Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.

How do I resolve build errors in Visual Studio?

In Visual Studio, go to the menu bar and choose Help > Send Feedback > Report a Problem, or submit a suggestion by using Help > Send Feedback > Send a Suggestion. You may find additional assistance for errors and warnings in Microsoft Docs Q&A forums.

How do I show build errors in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.


1 Answers

Update:

This has not been implemented yet. This is now tracked as a project on GitHub at: https://github.com/dotnet/roslyn/projects/18 - check there for updates.

Original response:

I've opened a VS question on this at: https://developercommunity.visualstudio.com/content/problem/48804/editorconfig-with-rules-set-to-error-produces-erro.html that will hopefully provide some answers on why errors coming from the new .editorconfig support in VS2017 do not fail builds.

like image 137
Adam Knights Avatar answered Oct 05 '22 18:10

Adam Knights