My web app was running fine on my localhost. After deploying onto a shared server (1&1), I'm getting the following error - any ideas? If I remove the mediachase stuff from my web.config, my app works.
Attempt to access the method failed.
[MethodAccessException: Attempt to access the method failed.]
System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags) +0
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +212
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) +55
System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +18
Mediachase.FileUploader.McHttpModule.694a7e1d01f817ae(Object 337e217cb3ba0627, EventArgs fbf34718e704c6bc) +1109
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Answer:
You are right. It's a problem with Medium Trust. ASP.NET 2.0 with Medium-trust turn-off ReflectionPermission.
To solve it, now, I can suggest you two way:
Turn-on ReflectionPermission
Find *:\WINDOWS\Microsoft.NET\Framework\v2.0.*\CONFIG\web_mediumtrust.config file.
Create a copy.
Opend web_mediumtrust.config file.
Add lines into SecurityClasses section
Add lines into PermissionSet section named ASP.Net
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ASP.Net">
More info: http://blog.chilkatsoft.com/?p=116
, Giving Full Trust to a Strong-Named Assembly in a Medium Trust Environment
You send me your order information and I'll send strong-named Mediachase FileUploader.Net assembly and a modification file.
More info: http://west-wind.com/WebLog/posts/6344.aspx