locked
How to automatically comment out code on debug mode RRS feed

  • Question

  • User-697484618 posted

    Hi

    I know how to automate different web.config files using debug and release and I'm wondering if something similar is possible in all file types.

    In particular I need to comment out some code in a mvc view e.g. 'Google Analytics' for staging environment.

    Any approach is appreciated

    Wednesday, October 16, 2013 6:39 AM

Answers

  • User1470282298 posted

    Hi,

    in MVC you can do that:

    @{
    
      #if DEBUG
     
    
      #else
        
    
      #endif
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 16, 2013 12:24 PM