Jump to content
  • Advertisement
Sign in to follow this  
nickwinters

[.net] C# Preprocessor checking what solution name is?

This topic is 4521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to have the C# preprocessor check what the solution name is? I wanna do something like #if SOLUTIONNAME="Client" callfunction(); #endif Thanks. -Nick

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Krisc
Wouldn't he have to define it using #define CLIENT, then?
Either that or, in VS2005, right click on your project, goto Properties. Change to the Build tab and add "CLIENT" to the Conditional compilation symbols. You add multiple symbols by using a semi-colon.

This is the same method used with #if DEBUG [wink].

Share this post


Link to post
Share on other sites
I'm not sure why you're doing this at the pre-processor stage - perhaps becuase the function is in an unreferenced assembly in some solutions ? Anyhow, if you need to do this at runtime I tend to use GetExecutingAssembly and check its name.

Phillip Hamlyn

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!