The error about "Attempt to access the method failed"

      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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值