AllowPartiallyTrustedCallers

Discussion about the open-source Phalanger [?] project.

RE: AllowPartiallyTrustedCallers

Postby schizoidboy@codeplex » June 30th, 2007, 7:46 pm

System.Security.SecurityException: That assembly does not allow partially trusted callers.

Server stack trace:
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at PHP.Core.Externals.InitCollocation()
at PHP.Core.Externals.InitializeExtMans()
at PHP.Core.Externals.EndRequest()
at PHP.Core.ScriptContext.RunApplication(Delegate mainRoutine, String relativeSourcePath, String sourceRoot)
at Dorp.DorpletHost.Hosts.PhpHostedProvider.OnRender(RenderParameters parameters)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at 0:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
PhpNetCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71
The method that caused the failure was:
PHP.ExtManager.RemoteDispatcher Collocate()
The Zone of the assembly that failed was:
MyComputer
The Url of the assembly that failed was:
file:///C:/WINDOWS/assembly/GACMSIL/PhpNetCore/2.0.0.0_0a8e8c4c76728c71/PhpNetCore.dll
schizoidboy@codeplex
 
Posts: 10
Joined: January 7th, 2012, 8:37 pm

RE: AllowPartiallyTrustedCallers

Postby schizoidboy@codeplex » June 30th, 2007, 7:51 pm

Looking closer at the Exception, PhpNetCore was just the assembly in which it failed (as PhpNetCoredoes have AllowPartiallyTrustedCallers), but it looks like php4ts does not. This is where the exception was thrown from in Externals.cs:

private static void InitCollocation()
{
// load php4ts
Assembly ass = Assembly.Load("php4ts, Version=2.0.0.0, Culture=neutral, PublicKeyToken=43b6773fb05dc4f0");

// obtain reference to RemoteDispatcher (this is not a proxy!)
_localExtMan = (IExternals)ass.GetType("PHP.ExtManager.StartupHelper").InvokeMember("Collocate",
BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, null);
}
schizoidboy@codeplex
 
Posts: 10
Joined: January 7th, 2012, 8:37 pm

AllowPartiallyTrustedCallers

Postby schizoidboy@codeplex » June 30th, 2007, 7:52 pm

I am trying to use Phalanger in a partial trust AppDomain, but it fails...
schizoidboy@codeplex
 
Posts: 10
Joined: January 7th, 2012, 8:37 pm

RE: AllowPartiallyTrustedCallers

Postby schizoidboy@codeplex » July 1st, 2007, 4:50 pm

Potential fix would be to add

[assembly: System::Security::AllowPartiallyTrustedCallers];

into Stdafx.cpp in ExtSupport.PHP4 project
schizoidboy@codeplex
 
Posts: 10
Joined: January 7th, 2012, 8:37 pm


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 11 guests

cron

User Control Panel

Login

Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 5 minutes)
Most users ever online was 511 on April 27th, 2024, 10:11 pm

Users browsing this forum: No registered users and 11 guests