Why will Visual Studio.net 2008 lose debugging ability after adding global.asax file?

I am not getting a normal error message saying that debugging is not enabled by a red error message. If I delete my global asax file, my code will go to my breakpoint. If I add the file again, the project completely ignores any breakpoints. Here is the code inside my global asax file

Public class Global_asax Inherits System.Web.HttpApplication

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the session is started
    Application("concurentUsers") += 1
End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the session ends
    If Session("loggedout") = Nothing Then
        Application("concurentUsers") += -1
    End If
End Sub

Final class

So you can see it not so much. I get the following mailbox from visual studio when I start a project with a global .asax file.

" , : ( temp asp.net). , . , , " ".

, undebuggable , , . , , asax ( )

P.S. , -. , global.asax

+3
4

global.asax global.asax.cs( ). , Application global.asax - , (,/debug- /debug: pdbonly ).

+1

, Application.Lock. += -1 . -= 1

Application.Lock()
Application("concurentUsers") -= 1
Application.UnLock()

.

0

ASP.NET.

.

, .

0

. , , , push-to-production "" Active (Debug) Release " " " " ( " // " ). " (Debug)", , , " " . , " " " ". " ", .

So, the short answer is: double-check that the option "Enable optimization" is not checked, and "Generate debugging information:" is set to full or pbd-only in the advanced compiler settings.

Hth,

James.

0
source

Source: https://habr.com/ru/post/1708901/


All Articles