2

I have an owin startup class, and I defined the assembly:

[assembly: OwinStartup(typeof(OptCode.PortalAPI.Startup))]

The class name is "Startup" and I have a Configuration method:

public void Configuration(IAppBuilder app)

In web config, I have defined the following owin settings:

<appSettings>
  <add key="owin:appStartup" value="OptCode.PortalAPI.Startup" />
  <add key="owin:AutomaticAppStartup" value="true" />
</appSettings>

The application is in an application pool in the version v4.0 and in integrated mode, I also have installed the nuget package Microsoft.Owin.Host.SystemWeb, but it still don't hit the breakpoint when I put it inside the configuration method in startup class.

William
  • 502
  • 1
  • 9
  • 27
  • Can you include the entire startup class including the namespace declaration? It looks like the problem is with namespace in your OwinStartup you declare the path as App.PortalAPI.Startup, but in the webconfig it's OptCode.PortalAPI.Startup. I personally have never used the owin:appStartup key when I use the Owin pipeline. – Woot Apr 25 '17 at 21:03
  • @Woot I have changed it now, but it still doesn't works(I'll update my question too). – William Apr 25 '17 at 21:14
  • sorry deleted my answer no I was running on IIS express I missed that in your question. Have you tried just throwing an error in the Configuration method to see if IIS is even executing the method? – Woot Apr 26 '17 at 12:45
  • 1
    @Woot I have tried it now, adding a `throw new Exception` in the Configuration method, and it actually throws an exception, but I still can't hit the breakpoint inside the method. – William Apr 26 '17 at 13:45
  • but it hits other break points in the app? I wonder if it loads the symbols after it runs the Owin startup. Seems like that's what it's doing. I wonder if there is a way around that? – Woot Apr 26 '17 at 17:07
  • @Woot yes, it hits other breakpoints, only when the breakpoint is in configuration method in startup class it's not hit. – William May 16 '17 at 12:34
  • 1
    I have the same issue ! – Anas Tina Dec 14 '17 at 10:02
  • I had the same issue, and what fixed my problem was to put a backslash at the end of the ReturnUrl. Here is my reply to a similar SO issue: https://stackoverflow.com/a/49141465/943746 – niki b Mar 06 '18 at 23:13

0 Answers0