#region descriptions compiled into .exe in .net?
Asked Answered
S

4

6

Are #region/#endregion directive "descriptions" compiled into the .EXE in .NET? I understand that comments are NOT, but I often chunk groups of code within a region and give it a useful description.

I want to make sure these descriptions are not visible in my compiled code. (I am not looking for obfuscation information. Thanks, though.)

Speleology answered 31/12, 2012 at 15:38 Comment(1)
Not unless you set the build action to Embedded Resource on the .cs file!Overcritical
H
4

Region is the one of C# Preprocessor Directives.

Although the compiler does not have a separate preprocessor, the directives described in this link

http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.110).aspx

are processed as if there were one.

But I wonder that, what is the aim of this question? :)

Hispania answered 31/12, 2012 at 15:43 Comment(1)
Thank you for the quick reply. The aim is to hide what is going on in the code from people who may be looking to "crack" the code and get around security measures.Speleology
T
8

No, they aren't. They are Preprocessor expressions, which won't end up in code.

Thong answered 31/12, 2012 at 15:39 Comment(0)
F
8

No, they're not. Region descriptions are basically comments, and aren't included in either the assembly itself or the PDB.

Forwarding answered 31/12, 2012 at 15:39 Comment(0)
H
4

Region is the one of C# Preprocessor Directives.

Although the compiler does not have a separate preprocessor, the directives described in this link

http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.110).aspx

are processed as if there were one.

But I wonder that, what is the aim of this question? :)

Hispania answered 31/12, 2012 at 15:43 Comment(1)
Thank you for the quick reply. The aim is to hide what is going on in the code from people who may be looking to "crack" the code and get around security measures.Speleology
L
2

No, they aren't. They are like comments. Look at Pre-processing directives

The pre-processing directives provide the ability to conditionally skip sections of source files, to report error and warning conditions, and to delineate distinct regions of source code. The term "pre-processing directives" is used only for consistency with the C and C++ programming languages. In C#, there is no separate pre-processing step; pre-processing directives are processed as part of the lexical analysis phase. Pre-processing directives are not tokens and are not part of the syntactic grammar of C#. However, pre-processing directives can be used to include or exclude sequences of tokens and can in that way affect the meaning of a C# program.

Lavena answered 31/12, 2012 at 15:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.