WCF AppFabric IIS 7.5

Oct 12, 2011 at 4:42 PM

I'm having very strange registration problem with Unity Auto Registration in a WCF service on a IIS 7.5 AppFabric server.

In narrowing down the issue we made it scan the bin directory every time the service was requested.  The service would work for a few and then stop.

Were using an IInstanceProvider to plug unity into the WCF pipeline.

If I register using unity.register<>() everything works fine all of the time.

I'm not an expert with WCF but we've chased down everything we could think of on that side.



Oct 18, 2011 at 9:34 AM

I'm not sure what happens.

If you could attach minimal solution reproducing the issue, I can have a look into to see whether I can help.

Oct 18, 2011 at 10:15 AM

Actually one thing I can think of is that when service is resolved from the container by WCF, it may not be registered there because auto registration scan all assemblies that are loaded into current application domain by the time of the scan, but if nothing uses concrete service type yet, assembly may not be loaded yet and auto registration doesn't happen. Obviously unity.register<>() references the concrete type. Try following just before auto registration try putting the line like: var test = typeof(ConcreteServiceTypeYouHaveIssueWith); (or reference it explicitly in any other way) and see what happens.