code after preprocessor / macro

G

Guest

Hi,
I have written C# code. And I have used preprocessor / macro in it.

I want to get the C# code after processing preprocessor, I have defined
durcng compile time. How can I get this code?

Is there any csc compiler option, that can produce the code after processing
the macros/preprocessors?

Thank you,
Avin Patel
 
J

Jon Skeet [C# MVP]

Avin Patel said:
I have written C# code. And I have used preprocessor / macro in it.

I want to get the C# code after processing preprocessor, I have defined
durcng compile time. How can I get this code?

Is there any csc compiler option, that can produce the code after processing
the macros/preprocessors?

No - C# doesn't *have* macros or a preprocessor. It has "pre-processing
directives" which are named that way because they look similar to C/C++
ones, but there's no actual pre-processor.
 
G

Guest

Hi,
Well, It doesn't matter, What you call? MACRO, preprocessor or
*pre-processor directive* Or act like preprocessor. In the end it does the
same job as the C++ pre-processor does.

So my question is, How can I get the C# code after compiler has done
processing this "pre-processor"?
As the C++ compiler has the facility to obtain the C++ code after compiler
has done pre-processing.

Thank You,
Avin Patel
 
J

Jon Skeet [C# MVP]

Avin Patel said:
Well, It doesn't matter, What you call? MACRO, preprocessor or
*pre-processor directive* Or act like preprocessor. In the end it does the
same job as the C++ pre-processor does.

Not quite - because there's no separate pre-processor step.
So my question is, How can I get the C# code after compiler has done
processing this "pre-processor"?

It doesn't go from non-pre-processed code to pre-processed code.
There's no extra step.
As the C++ compiler has the facility to obtain the C++ code after compiler
has done pre-processing.

That's because C++ has a pre-processor. C# doesn't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

#define in C# 3
xml,xlt, xsl 4
C# Preprocessor 3
#define 3
passing define into a build 3
.NET 2005 Pre-processing directives 2
Predefined preprocessor for C#? 1
C++ to VB conversion and preprocessor definition 2

Top