Question

I've created a Wcf Service to back a Ajax page (.Net 3.5). It's hosted in IIS 6.1 Integrated Pipeline. (The rest of Autofac is setup correctly for Web Forms integration).

Everything works fine and dandy with the normal Wcf pipeline. However when I plug in the Autofac Wcf Integration (as per the Autofac wiki) I get this delightful exception:

[SecurityException: That assembly does not allow partially trusted callers.] Autofac.Integration.Wcf.AutofacHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) in c:\Working\Autofac\src\Source\Autofac.Integration.Wcf\AutofacHostFactory.cs:78 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +604 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +46 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +654

My Google-fu has failed me on finding a solution to this problem. Any insights or workarounds would be appreciated.

Was it helpful?

Solution

This problem is unrelated to Autofac.

When downloading executables / dlls, Vista and Windows 7 helpfully "block" those files.

To get my project working I had to find the Autofac DLLs I had downloaded and was referencing in my project, right click, Properties -> General -> "Unblock"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top