asp.net mvc3中基于角色的授权

时间:2013-02-27 15:58:05

标签: asp.net-mvc authorization

您好,是新的ASP.NET MVC。目前正在从asp.net官方网站上学习MVCmusicstore教程。但是在执行基于角色的授权后执行项目时出现错误。堆栈跟踪如下:请咨询

堆栈追踪:

[FileLoadException:无法加载文件或程序集'System.Runtime.DurableInstancing,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其中一个依赖项。

句柄无效。 (HRESULT异常:0x80070006(E_HANDLE))]    System.RuntimeTypeHandle.CreateInstance(RuntimeType类型,Boolean publicOnly,Boolean noCheck,Boolean& canBeCached,RuntimeMethodHandleInternal& ctor,Boolean& bNeedSecurityCheck)+0

System.RuntimeType.CreateInstanceSlow(Boolean publicOnly,Boolean skipCheckThis,Boolean fillCache)+98

System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,Boolean skipVisibilityChecks,Boolean skipCheckThis,Boolean fillCache)+241

System.Activator.CreateInstance(Type type,Boolean nonPublic)+69

System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,Binder binder,Object [] args,CultureInfo culture,Object [] activationAttributes)+1136

System.Activator.CreateInstance(Type type,BindingFlags bindingAttr,Binder binder,Object [] args,CultureInfo culture,Object [] activationAttributes)+111

System.Activator.CreateInstance(Type type,BindingFlags bindingAttr,Binder binder,Object [] args,CultureInfo culture)+23

System.Web.HttpRuntime.CreateNonPublicInstance(Type type,Object [] args)+60

System.Web.Configuration.HttpModulesSection.CreateModules()+221

System.Web.HttpApplication.InitModules()+ 28

System.Web.HttpApplication.InitInternal(HttpContext context,HttpApplicationState state,MethodInfo [] handlers)+828

System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context)+304

System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)+107

System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)+327

1 个答案:

答案 0 :(得分:0)

看起来您缺少对以下程序集的引用:

System.Runtime.DurableInstancing

右键单击该项目,选择"添加参考"并添加此程序集。