0

I am using OWIN to implement Microsoft's Identity 2.0 in an MVC5 application.

Everything works fine in my development environment (VS 2013 - V12+ Update 4, IIS Express).

However when I upload the application to my IIS Test Server that only runs this application, IIS will hang on any page request in the application for a period of time (22-34 seconds). Sometimes it accesses the page instantaneously without hanging then after a period of time the hang comes back. Examining the IIS worker process always shows the hang happening on:

_DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Micorosoft.Owin.Host.SystemWeb, Version=etc

Resolution Process after reading SO.com:

I thought it may be due to Application Pools recycling (set the Idle TimeOut from 20 to 0). Problem remained.

Deleted entire web application, started fresh install. Problem remained.

Deleted ASP.NET Temporary files, recycled the Application Pool. Problem remained.

Checked the connection strings to the database. Connectivity / initial catalog exists and functional. * This had been an issue in other posts.

DNS was the problem : A secondary DNS server in the web server's ethernet configuration was pointing to an additional DNS server that was outside the server farm's domain. The application module would occasionally utilize this DNS server which obviously could not resolve / locate the database server necessary for functionality of the Microsoft Identity feature via the integrated OWIN pipe. This was leading to the "hang" until the module would time out (24-34 seconds later).

  • Does the hang occur in your code, or somewhere else, where you cannot attach an debugger? Do you have any extensive pre-run tasks? – TGlatzer Feb 01 '15 at 17:36

1 Answers1

0

Is the assembly signed with codesign certificate? If so, try to edit machine.config, i.e. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config. Add this

<runtime>
    <generatePublisherEvidence enabled="false" />
</runtime>

It seems that .NET tries to verify signature of the assembly and it can take 20-30s to complete in some cases. More info can be found here.

Community
  • 1
  • 1
pepo
  • 8,644
  • 2
  • 27
  • 42