开发者

Structure map with a ASP.Net webservice

开发者 https://www.devze.com 2023-01-20 11:28 出处:网络
All our apps have been converted to use strucutre map, and our libraries were converted also. I\'m trying to convert one of our asp.net webservices.

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

I'm trying to convert one of our asp.net webservices.

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 strucutre map, and have a 20 seconds delay whilte it's scans and bootstraps.

Is there a way to get around this?

Than开发者_如何学JAVAks,

Eric-


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


Why do you have to bootstrap in the constructor? You bootstrap on application start, not in a constructor of anything. Shows us your code.


I get it now, the webService Didn't have an Global.axas/*.cs so I thought I had to bootstrap elsewhere, but I'd forgotten you can just add one to a web service.

I bet that'll fix it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号