开发者

Web Site Administration Tool - Type is not resolved for member 'StructureMap.StructureMapException'

开发者 https://www.devze.com 2023-01-24 01:49 出处:网络
I think a picture will serve me best: Any Ideas?My web app works just fine.I don\'t really 开发者_高级运维use the web site administration tool, I just taught I\'d play with it and discovered that t

I think a picture will serve me best:

Web Site Administration Tool - Type is not resolved for member 'StructureMap.StructureMapException'

Any Ideas? My web app works just fine. I don't really 开发者_高级运维use the web site administration tool, I just taught I'd play with it and discovered that the security tab doesn't work and I can't figure out why. I'm using my own membership and role provider which do make use of Structuremap. It's like the Web Site Administration Tool doesn't know about the Structuremap.dll. I'm just not sure how to fix that.


Should anyone else run across this problem...

While I'm still not sure why the StructureMapException type couldn't be resolved, the more important part is the fact that an exception is thrown in the first place. I realized that the RoleProvider is loaded when the AppDomain first initializes and not necessarily at a particular point within the scope of your Global.asax file. The exception was the result of StructureMap not being properly initialized when the RoleProvider tried to get an instance of a class I thought was registered but wasn't.

Given that there are other issues with maintaining synchronization between the ObjectFactory in the providers and ObjectFactory through the page life-cycle I ended up deciding to take the dependency injection out of the Role and Membership providers and treating them as entirely independent objects. Doing this resolved the exception which allowed me to move on.

0

精彩评论

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

关注公众号