Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
182 views

Ctrl + K + D - The style sheet contains syntax errors and cannot be formatted

In Visual Studio, when pressing Ctrl + K + D to format code, I'm getting this error As per the suggestion, I've tried to solve the issue: In Visual Studio, open the Tools menu and select Options ...
Zameer Ansari's user avatar
1 vote
1 answer
2k views

Modify auto-format code settings in Visual Studio

At my current job there are some coding guidelines that every programmer has to follow. In those guidelines there are some guidelines related to code formatting. Like there must be a space after 'if' ...
Zia ur Rehman's user avatar
3 votes
1 answer
1k views

Visual studio formatting of selection in CSS editor not working

Some strange issue appeared while working in Visual Studio 2010. Formatting for whole CSS file works fine CTRL+K,CTRL+D, but trying to format code inside of selection CTRL+K,CTRL+F shows an error: ...
Johnny_D's user avatar
  • 4,632
2 votes
1 answer
2k views

visual studio 2010 inserts using directives inside namespace

I have exactly opposite problem to one described here. In my case Visual Studio inserts using directives inside namespace and I want to prevent this. I did try to uncheck Resharper option: Languages ->...
Serhiy's user avatar
  • 4,437
25 votes
5 answers
18k views

How can you force StyleCop to ignore a file?

I've included a 3rd party .cs file in my code. It doesn't comply with StyleCop's rules but I desperately need to be able to exclude it from StyleCop's checks but none of the methods I've found so far ...
NickG's user avatar
  • 9,705
3 votes
1 answer
2k views

Visual Studio 2010 Auto-Formatting ASPX maladies

Alright. I've done a LOT of searching around, and found many posts that address this issue, but do not actually have any resolutions. Visual Studio 2010 really likes auto-formatting my code. This is ...
FireSBurnsmuP's user avatar
0 votes
3 answers
803 views

Codemaid-Like Tool for VB.NET [closed]

I used to do a lot of work in C# but recently I got into a new role as a VB.NET developer. When I was doing C# I got to really like CodeMaid as an auto-formatting tool. Is there a tool like it for VB....
Valandres's user avatar
1 vote
2 answers
371 views

Visual Studio 2010 (C#): Blank before and after * when multiplying

I noticed a strange behavior in Visual Studio 2010 when programming C#. When I type var x = 2 * 5 and then enter ';' VS changes the line to var x = 2*5; So it removes the blanks. On the other hand,...
Hendrik's user avatar
  • 85
2 votes
0 answers
345 views

Is there a way to prevent MS/VS mixing tabs and spaces?

Whenever I have to open a *.Designer.cs file, I get a bar across the top that says, "You have mixed tabs and spaces. Fix this?" with the following buttons "Tabify" "Untabify" and "Don't show again" I'...
B. Clay Shannon-B. Crow Raven's user avatar
0 votes
1 answer
134 views

VS.NET - Add in for automatically formatting C# code

Is there any VS.NET add in for formatting C# as you type based on the given rules? Except for ReSharper, as it does so many other things and slows down VS.NET due to that, so I'm looking for a light ...
dr. evil's user avatar
  • 27.2k
3 votes
1 answer
1k views

Visual Studio 2010 source formatting HTML div tag

I've got my div tags set to insert line breaks "Before opening, within, and after closing" but I'm not getting the line break after the content. I'm getting this: <div> content</div> ...
Justin Self's user avatar
  • 6,205
1 vote
1 answer
1k views

Is there any way to stop Visual Studio from removing empty spaces after Ctrl+E+D

I've got a view that has the following code: <ul class="nav nav-tabs"> <li class="active"><a href="#General" data-toggle="tab"><i class="icon-home"></i> General</...
LukeP's user avatar
  • 10.4k
3 votes
1 answer
228 views

Can I exclude part of code from Format Document in Visual Studio

I have some transliteration tables in code that are formated to make it easier to see pairs, simplified example : oldChar = new string[] { "Æ", "æ", "Å", "å", "Ä", "ä", "Ø", "ø", "Ö", "ö" }; ...
Antonio Bakula's user avatar
28 votes
5 answers
69k views

Visual Studio Ctrl K + D (code formatting) not working

Ctrl K + D in a Visual Studio 2010 Sharepoint project is not working in some files as they contain paths to some resources (masterpageurl/images/js/css classnames) that get generated at runtime. How ...
tempid's user avatar
  • 8,088
2 votes
4 answers
2k views

Cleanup spacing - C++ / Visual Studio 2010

Is there a built-in feature or available add-on for Visual Studio 2010 that will clean up spacing in C++ code so that annoying blocks like this: RandomVar=RandomList.RandomMethod(); will become ...
newenglander's user avatar
  • 2,029

15 30 50 per page