"动态操作只能在同质的AppDomain&QUOT进行;错误 [英] "Dynamic operations can only be performed in homogenous AppDomain" error

查看:291
本文介绍了"动态操作只能在同质的AppDomain&QUOT进行;错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑在我的locahost一个MVC3的网站时收到此错误。这仅仅是新创建一个新的MVC3站点时,的HomeController 首页方法,在这里它被从抛出,在 ViewBag.Message 分配。

I'm getting this error when running an MVC3 site on my locahost. It is a fresh MVC3 site just newly created, the HomeController Index method is where it's being thrown from, on the ViewBag.Message assignment.

public ActionResult Index()
{
    ViewBag.Message = "Welcome to ASP.NET MVC!";
    return View();
}

堆栈跟踪:

at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at MVC3.Web.UI.Controllers.HomeController.Index() in C:\Users\mccarthy\Documents\Visual Studio 2010\Projects\MVC3\MVC3.Web.UI\Controllers\HomeController.cs:line 13
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)

我不知道这个错误是什么,以前还没有看到它。当我启动了一个新项目MVC2(我一直使用的是什么,直到这点),该网站运行得很好。

I have no idea what this error is and haven't seen it before. When I start up a new MVC2 project (what I've been using up until this point), the site runs just fine.

有没有微软如何对待MVC3和MVC2框架之间的安全性存在差异?

Is there some difference in how Microsoft treats security between the MVC3 and MVC2 frameworks?

推荐答案

好吧,看来如果你在你的web.config以下行:

Okay, it seems that if you have the following line in your web.config:

&LT;信任legacyCasModel =真实水平=完全/&GT;

这种类型的错误可能发生。然而,在PHeiberg提供给我的链接,它表示,该行可能会在web.config中。我的web.config中没有它。

this type of error could happen. Yet in the link that PHeiberg provided to me, it said the line could be in web.config. My web.config did not have it.

所以,我看着在machine.config中,有是code线!我评论它,我现在就可以运行我MVC3应用程序。

So I looked in machine.config, and there was the code line! I commented it out, and I can now run my MVC3 app.

我也不太清楚它是如何在machine.config中结束了,还是什么别的我可能会打破和我的结果注释出来,但这个迫在眉睫的问题是固定的。

I'm not too sure how it ended up in machine.config, or what else I might have broken as a result of me commenting it out, but this immediate problem is fixed.

这篇关于&QUOT;动态操作只能在同质的AppDomain&QUOT进行;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆