security exception when constrcuting windsor container

8 views
Skip to first unread message

PB

unread,
Nov 5, 2012, 9:56:44 PM11/5/12
to castle-pro...@googlegroups.com
I am trying to run Castle in medium trust env. I have added the APTC tag and the [assembly: SecurityRules(System.Security.SecurityRuleSet.Level1)] to Castle.Core and Castle.Windsor which allowed the assemblies to run in medium trust.

but now i get security exception while initialising the container.

at Castle.Core.Internal.PermissionUtil.IsGranted(IPermission permission) at Castle.MicroKernel.DefaultKernel..ctor(IDependencyResolver resolver, IProxyFactory proxyFactory) at Castle.MicroKernel.DefaultKernel..ctor() at Castle.Windsor.WindsorContainer..ctor() at xxxxxxx.xxx.Common.Facilities.ContainerFactory..ctor() in C:\Source\xxx\xxx\xxx.xxx\Facilities\ContainerFactory.cs:line 18 at

here's the conatinerfactory class

public sealed class ContainerFactory
{
    private static volatile ContainerFactory _instance;
    private static readonly object SyncRoot = new object();

    private static IWindsorContainer _container;

    private ContainerFactory()
    {
        // Initialize windsor container.
        _container = new WindsorContainer();

        // NOTE: register concreate type with windsor
        // container.Register(Component.For<FooObjectContext>());
        _container.Install(FromAssembly.Named("xxxxxxx.xxx.xxxxxxxxx"));
    }

    public static IWindsorContainer CreateContainer()
    {
        if (_instance == null)
        {
            lock (SyncRoot)
            {
                if (_instance == null)
                    _instance = new ContainerFactory();
            }
        }

        return _container;
    }
}

What can I do to fix this. Thanks
Reply all
Reply to author
Forward
0 new messages