#If DEBUG is ignored (VB.net or C#)

前端 未结 8 1123
青春惊慌失措
青春惊慌失措 2021-02-05 13:33

I have several of these in my code which have been working fine so far:

#If DEBUG Then    
   ... some code here       
#End If     

Now, i am

8条回答
  •  走了就别回头了
    2021-02-05 13:48

    C# Project ( Visual Studio )

    1. go to: Project Properties -> Build(tab)
    2. Select Configuration: Release
    3. Uncheck "Define DEBUG constant"

    4. Now select Configuration: Debug

    5. Check "Define DEBUG constant"

    6. In your code, you can now type the following ( DEBUG with uppercase )

    #IF DEBUG
    
    // Debugging code goes here
    
    #ENDIF
    

提交回复
热议问题