views:

52

answers:

1

I just followed this example to bootstrap WCF with StructureMap. At the same time I've been using StructureMap in my ASP.NET application (IIS6), which is initialized in Global.asax.Application_Start().

The two configurations have different requirements. Unfortunately, StructureMap is configured statically, and contrary to my expectations it's shared between the web app and WCF. As a result, the last "Initialize()" called wins!

Is it possible to give each one its own configuration? Or is the only solution to fold them together?

A: 

How are you setting up your IIS application pools - are both apps running in the same pool?

If they are you could trying running them in seperate app pools because then they will be created in seperate app domains, and therefore you should get different StructureMap container instances...

AWC
That's a good idea. I bet that would work.
roufamatic
Sorry for taking so long to accept. I didn't have a chance to try this solution out, but it obviously will do the job, so thanks!
roufamatic