Search code examples
asp.netwcfiisdelay

Methods in the namespace System.Security.Cryptography take 2 minutes to perform when service is hosted in IIS


I built an ASP.NET web-service that uses the System.Security.Cryptography namespace when it handles its requests.

When I hosted the service in ASP.NET Development Server, everything worked fine. Then I moved the service into IIS, still using localhost addresses, and surprisingly, each time the service calls a method from the specified namespace, it takes 2 minutes to complete! If a single request requires the service to call 3 methods of the specified namespace, then the request takes total of 6 minutes to complete!

The traces show that the request has been received on time, and they show an interval of around 2 minutes upon each call to the specified namespace.

Did anyone see this strange behavior elsewhere? Any speculation would be appreciated!


Solution

  • The accepcted answer would be : change the application's pool identity and check the "load user profile" so that cryptographic services can be used on behalf of app pool identity.