Debug.WriteLine() is not hit

后端 未结 5 1929
时光取名叫无心
时光取名叫无心 2021-01-07 09:01

I am debugging a Windows service (by hitting F5 in Visual Studio 2010) using the following code:

In Program.cs file:

         


        
5条回答
  •  别那么骄傲
    2021-01-07 09:37

    I had the same random problem.

    I was able to just fix it by:

    1. Uncheck the Project Properties -> Build -> Define DEBUG constant
    2. Click Save
    3. Check 'Define DEBUG constant' option again
    4. Click Save
    5. Rebuild the Project
    6. Run

    After doing this it hit the #if DEBUG line as expected.

提交回复
热议问题