#if debug --> #if myOwnConfig?

IntegerWolf picture IntegerWolf · Aug 26, 2013 · Viewed 21.8k times · Source

is there a way in Visual Studio to use a custom Configuration like "#if DEBUG"

I need a "#if OFFLINE" as my Build-Config's name is "Offline" (only for further debug-purposes too)...

Thanks!

Answer

Dennis picture Dennis · Aug 26, 2013

Yes, this is possible.

Instructions:

  1. Build -> Configuration manager -> Active solution configuration -> New...
  2. Create a new configuration named: Offline.
  3. Project -> Properties -> Build -> Configuration -> Offline.
  4. Conditional compilation symbols, type: OFFLINE.
  5. Save project.
  6. Restart Visual Studio (reloading the project is not enough).