In VB.net websites, VS2008 ALWAYS uses space indentation for new files

Posted by Jez on Stack Overflow See other posts from Stack Overflow or by Jez
Published on 2010-04-16T09:32:23Z Indexed on 2010/04/17 2:33 UTC
Read the original article Hit count: 347

So, I've changed my settings in Tools | Options | Text Editor, for All Languages, Basic, and C#, to having Block indenting, and 'Keep tabs'. I've also tried this with Smart indenting too. Now, although once I start editing a file, its auto indentation is done with tabs, when I create a new web form in my ASP.net website, VS2008 insists on creating the initial code with space indentation. So for example, I'll get an aspx.vb file for my new page like so:

Partial Class Admin_Index
    Inherits System.Web.UI.Page

End Class

Note that the 'Inherits' line is SPACE-indented, even though I have the text editor settings set to keep tabs. Is there any way I can make the default created files indented with tabs, not spaces? Or is VS just too stubborn? :-)

By the way, please don't just respond and say this is petty as I can quickly change that one line of indentation to using a tab. I know this, but I have a software team that find it irritating as we have an SVN hook that prevents checkins if there's any space-indentation. It would be very useful if any newly-created files have tab indentation from the start, rather than us having to change it every time.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about ASP.NET