Search code examples
web-servicesasmxstructuremap

Structure map with a ASP.NET webservice


All our apps have been converted to use StructureMap, and our libraries were converted also.

I'm trying to convert one of our ASP.NET web services.

If I understand, correctly, I'll have to bootstrap the StructureMap stuff in the constructor of the web service.

But the constructor gets called with each web method called, so each request is going to bootstrap StructureMap, and have a 20 seconds delay while it scans and bootstraps.

Is there a way to get around this?


Solution

  • You will likely want to bootstrap in the Application_Start method of the global.asax.