End Google Ads 201810 - BS.net 01 --> Hello everyone!

To illustrate my question, here is a minimal amount of code showing off the problem:
#define TEST

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
if (true) {
DoSomething();
}
#if TEST
else {

}
#endif
}

private static void DoSomething() {
throw new NotImplementedException();
}
}
}

I have kept the indentation that Microsoft Visual C# provides.

Look at the else-block. Its indentation is wrong. It should be indented to the same position as if (true).

My guess is that MSVC# thinks that the else belongs to the compiler directive #if.

Is there any way to make MSVC# indent the else-line correctly? (I'd prefer not to do it manually since I use the in-built Reformat Document function.)

I am using Visual C# 2008 SP1 by the way.


Thanks in advance,
F2

modified on Friday, January 29, 2010 4:31 PM