appfabriccode-access-securitymedium-trustfull-trustpartial-trust

Windows Server AppFabric Caching


I'm currently working on a ASP.NET MVC site where we have to run in partial trust. Now I'm facing a problem with connecting to AppFabric when in High Trust. No problems when running in full trust. What Permission do I need in my web_hightrust.config file.

The method failing looks like this:

    [SecuritySafeCritical]
    [PermissionSet(SecurityAction.Assert, Unrestricted = true)]
    private static DataCacheFactory InitializeFactory()
    {
        try
        {
            DataCacheFactoryConfiguration configuration = GetDataCacheFactoryConfiguration();

            Logger.Debug("Initializing a DataCacheFactory");
            DataCacheFactory factory = new DataCacheFactory(configuration);

            return factory;
        }

        catch (Exception ex)
        {
            Logger.ErrorFormat("Construction of factory failed: {0}", ex.ToString());
            throw;
        }
    }

As you can see I have annotated the method with what I think should be enough to make the connection, but it fails.

Any ideas appreciated.


Solution

  • The answer is:

    AppFabric is using WCF with net.tcp which requires full trust.

    I have been communicating with a principal development lead in the AppFabric Cache, and he told me that this is something that they will look into as part of a future release.

    So as for now, please consider if AppFabric Caching can be utilized in your environment considering the security demands you have.

    http://msdn.microsoft.com/en-us/library/bb412186.aspx

    /Tonni