What is the scope of a C# compiler directive (such as #pragma)? Where should such a directive be stated, and where does it take effect?
The C# specification is somewhat vague on this point.
What is the scope of a C# compiler directive (such as #pragma)? Where should such a directive be stated, and where does it take effect?
The C# specification is somewhat vague on this point.
The first line in the documentation is quite clear:
#pragma gives the compiler special instructions for the compilation of the file in which it appears.
So it just concerns the file the directive is in. If you put in the directive half-ways it is applied to the lower half.