SecurityException: That assembly does not allow partially trusted callers in Full trust environment

183 views
Skip to first unread message

Sunil

unread,
Apr 5, 2010, 12:49:32 PM4/5/10
to Castle Project Users
I developed a small WCF service that uses Castle Windsor and it works
fine on my PC. When I deploy it onto a Win 2008 R2 server and host the
WCF service in IIS 7 it fails with the following error. I checked the
server level web.config and the trust level is set to "Full". What do
I need to do to get this to work.

Stack Trace:


[SecurityException: That assembly does not allow partially trusted
callers.]
Castle.Windsor.WindsorContainer..ctor() +0

WMS.ServiceContractImplementation.IoC.IoCInstanceProvider..ctor(Type
serviceType) in D:\WCF\WCFProofOfConcept\WMSServices
\WMS.ServiceContractImplementation\IoC\IoCInstanceProvider.cs:19

WMS.ServiceContractImplementation.IoC.IoCServiceBehavior.ApplyDispatchBehavior(ServiceDescription
serviceDescription, ServiceHostBase serviceHostBase) in D:\WCF
\WCFProofOfConcept\WMSServices\WMS.ServiceContractImplementation\IoC
\IoCServiceBehavior.cs:24

System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription
description, ServiceHostBase serviceHost) +377
System.ServiceModel.ServiceHostBase.InitializeRuntime() +37
System.ServiceModel.ServiceHostBase.OnBeginOpen() +27
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
timeout) +261
System.ServiceModel.HostingManager.ActivateService(String
normalizedVirtualPath) +121
System.ServiceModel.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath) +479


Message has been deleted

Sunil

unread,
Apr 5, 2010, 3:51:55 PM4/5/10
to Castle Project Users
As a test I deployed the same service as it is onto a Windows 2003
server with the trust level set to "Full" and it works fine. I am
unable to figure out what setting/configuration I am missing on the
2008 server that is making the service fail.

On Apr 5, 12:49 pm, Sunil <chsu...@gmail.com> wrote:
> I developed a small WCF service that uses Castle Windsor and it works
> fine on my PC. When I deploy it onto a Win 2008 R2 server and host the
> WCF service in IIS 7 it fails with the following error. I checked the
> server level web.config and the trust level is set to "Full". What do
> I need to do to get this to work.
>
> Stack Trace:
>
> [SecurityException: That assembly does not allow partially trusted
> callers.]
>    Castle.Windsor.WindsorContainer..ctor() +0
>
> WMS.ServiceContractImplementation.IoC.IoCInstanceProvider..ctor(Type
> serviceType) in D:\WCF\WCFProofOfConcept\WMSServices
> \WMS.ServiceContractImplementation\IoC\IoCInstanceProvider.cs:19
>

> WMS.ServiceContractImplementation.IoC.IoCServiceBehavior.ApplyDispatchBehav­ior(ServiceDescription


> serviceDescription, ServiceHostBase serviceHostBase) in D:\WCF
> \WCFProofOfConcept\WMSServices\WMS.ServiceContractImplementation\IoC
> \IoCServiceBehavior.cs:24
>

> System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(Ser­viceDescription

Krzysztof Koźmic

unread,
Apr 6, 2010, 2:11:30 AM4/6/10
to castle-pro...@googlegroups.com
same question asked here:
http://stackoverflow.com/questions/2582626/castle-windsor-security-exception

Which version are you using? Do you use just Windsor, or also WCF Facility?

Krzysztof

Sunil

unread,
Apr 6, 2010, 10:35:19 AM4/6/10
to Castle Project Users
I posted the same question at StackOverFlow.
I am using version 2.1 of Windsor behind a WCF Service. The WCF
service uses windsor to instantiate the services similar to whats
mentioned at the following link.
http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/29/integrating-structuremap-with-wcf.aspx

Once again as I said it works fine on my PC and on a 2003 server but
fails on a 2008 R2 server.

-Sunil.

On Apr 6, 2:11 am, Krzysztof Koźmic <krzysztof.koz...@gmail.com>
wrote:
> same question asked here:http://stackoverflow.com/questions/2582626/castle-windsor-security-ex...

> >> normalizedVirtualPath) +479- Hide quoted text -
>
> - Show quoted text -

Sunil

unread,
Apr 21, 2010, 1:03:32 PM4/21/10
to Castle Project Users
I got this issue resolved. A big thanks to "SarcasticBaldGuy" who had
a similar issue and posted the solution at the following link.
http://groups.google.com/group/castle-project-users/browse_thread/thread/0da71be71b16904d

-Sunil.

On Apr 6, 10:35 am, Sunil <chsu...@gmail.com> wrote:
> I posted the same question at StackOverFlow.
> I am using version 2.1 of Windsor behind a WCF Service. The WCF
> service uses windsor to instantiate the services similar to whats
> mentioned at the following link.http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/29/integ...
>
> Once again as I said it works fine on my PC and on a 2003 server but
> fails on a 2008 R2 server.
>
> -Sunil.
>
> On Apr 6, 2:11 am, Krzysztof Ko¼mic <krzysztof.koz...@gmail.com>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.

Krzysztof Koźmic

unread,
Apr 21, 2010, 2:21:36 PM4/21/10
to castle-pro...@googlegroups.com
Ah, cool.
I totally forgot about that one.
Glad you found the solution.

K
Reply all
Reply to author
Forward
0 new messages