Question about #define

  • Thread starter Thread starter afatdog
  • Start date Start date
afatdog,

You can not use macros in C#. The #define preprocessor directive is
used to define environment variables for things such as conditional
compilation and the like. It can not be used to define macros.

If you want to do this, then you should create a static method on a
type, and then set a reference to the assembly containing that type
everywhere you wish to use it.

Hope this helps.
 

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


Back
Top