goroth goroth - 6 months ago 96
C# Question

How to set breakpoint in ConfigureAuth?

I need to set a breakpoint in the ConfigureAuth to debug an issue we are having.

The following article claims you can set a breakpoint but this article is C# and I need this to work in VB.NET


I converted this:

app.Use(async (context, next) =>
await next.Invoke();

To this:

app.Use(Async Function(context, [next])
Await [next].Invoke()
End Function)

but I get an error the following error:

Parameter count mismatch.

Here are a couple of problems.

  1. I assumed that "context" was "Microsoft.Owin.OwinContext" but that is an invalid assumption. "context" in the VB project I think it is "Microsoft.Owin.Security.Cookies.CookieAuthenticationMiddleware"

  2. I don't know what the type is for "next"


Found here Is it possible to debug Global.asax?
per John Kelly

This lets me step into it from global.asx

  1. Attach the debugger to the IIS process.
  2. Open the global.asax file and put in a breakpoint.
  3. Add a space to the web.config file and save the file (this causes the current web application to reset);
  4. Refresh / goto a web page on the site.
  5. watch in amazement when the debugger stops at your breakpoint. :)