Alex Wang
Alex Wang

Reputation: 358

Visual studio 2017 not indenting code properly

I've just installed Visual Studio 2017 and began writing my ASP.NET MVC 5 web app. I've come across this issue where the indentation of code is not correct. What I noticed is that when I hit the semicolon on var priv = new Phonebase(); it will shift out of the scope that it belongs to.

I've played around with indentation settings for C#, but I couldn't remedy the issue. I've tried smart indentation and block indentation. Does anyone know how I can get Visual Studio to ident lines of code properly?

Incorrect indentation

Upvotes: 1

Views: 2279

Answers (1)

Josh
Josh

Reputation: 2222

I found a .editorconfig file in the root of my c drive (c:\.editorconfig). When I deleted this file, this issue went away for me.

See this page for more information and fixes with .editorconfig

Upvotes: 1

Related Questions