I'm trying to use NMS Version 1.6.0 with my code ('IntPub') that must run in a sandbox in a .NET 4.0 environment for security reasons. The code that creates the sandbox makes my code 'partially trusted' and therefore 'security-transparent' which seems to mean that it can't create a ConnectionFactory (see error log below) because NMS seems to be 'security-critical'. Here's the code that's causing this error:
connecturi = new Uri("tcp://my.server.com:61616"); var connectionFactory = new ConnectionFactory(connecturi); I also tried this instead with similar results: connecturi = new Uri("activemq:tcp://my.server.com:61616"); var connectionFactory = NMSConnectionFactory.CreateConnectionFactory(connecturi); Since I can't change the security level of my assembly (the sandbox prevents it) is there a way to make NMS run as 'safe-critical' so it can be called by 'security-transparent' code? I appreciate any help or suggestions... Thanks, Bill Assembly 'IntPub, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6fa620743b8dc60a' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> <ErrorCode>-2147220956</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>Unexpected exception from plug-in (Execute): Samples.WebClient: System.MethodAccessException: Attempt by security transparent method 'Samples.WebClient.Execute(System.IServiceProvider)' to access security critical method 'Apache.NMS.ActiveMQ.ConnectionFactory..ctor(System.Uri)' failed. -- View this message in context: http://activemq.2283324.n4.nabble.com/NMS-NET-4-0-Sandbox-Security-Question-tp4669278.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.