Razor 如何修复';无法加载文件或程序集';System.Web.Helpers,版本=2.0.0.0';DNN中的2sxc出错

Razor 如何修复';无法加载文件或程序集';System.Web.Helpers,版本=2.0.0.0';DNN中的2sxc出错,razor,2sxc,Razor,2sxc,我有一个本地DNN站点,我正在尝试使用2sxc模块创建内容/应用程序,然后再将其放到实际的生产站点上。我尝试安装Razor教程应用程序,当我将其放在页面上时,我得到以下输出: Error: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or o

我有一个本地DNN站点,我正在尝试使用2sxc模块创建内容/应用程序,然后再将其放到实际的生产站点上。我尝试安装Razor教程应用程序,当我将其放在页面上时,我得到以下输出:

Error: System.IO.FileLoadException: Could not load file or assembly 
'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
or one of its dependencies. The located assembly's manifest definition does not match 
the assembly reference. (Exception from HRESULT: 0x80131040) File name: 
'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
at Connect.Dnn.Koi.DnnSkinFile.AutoDetect() at Connect.Koi.Context.HttpContextState.TryToDetectTheCssFramework() at 
Connect.Koi.Context.HttpContextState.get_CssFramework() at Connect.Koi.Context.ToolsForCurrentState.get_Css() 
at Connect.Koi.Koi.Is(String expectedCss) at ASP._Page_Portals_0_2sxc_Tutorial_Razor_shared__bootstrap4_cshtml.<EnsureBootstrap4>b__0(TextWriter __razor_helper_writer) 
in c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial-Razor\shared\_bootstrap4.cshtml:line 5 at 
CallSite.Target(Closure , CallSite , _Page_Portals_0_2sxc_Tutorial_Razor_shared__helpers_cshtml , 
TextWriter , Object ) at ASP._Page_Portals_0_2sxc_Tutorial_Razor_shared__helpers_cshtml.<InitializedPageAssets>b__1e(TextWriter __razor_helper_writer) in 
c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial-Razor\shared\_helpers.cshtml:line 73 at System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, HelperResult content) at 
ASP._Page_Portals_0_2sxc_Tutorial_Razor_shared__helpers_cshtml.<>c__DisplayClass1.<Title>b__0(TextWriter __razor_helper_writer) in c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial-Razor\shared\_helpers.cshtml:line 2 at 
System.Web.WebPages.WebPageBase.Write(HelperResult result) at ASP._Page_Portals_0_2sxc_Tutorial_Razor__home_cshtml.Execute() in c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial-Razor\_home.cshtml:line 3 
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) 
at ToSic.SexyContent.Engines.RazorEngine.Render(TextWriter writer) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 65 at ToSic.SexyContent.Engines.RazorEngine.RenderTemplate() 
in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 93 at ToSic.SexyContent.Engines.EngineBase.Render() in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\Engines\EngineBase.cs:line 92 
at ToSic.SexyContent.SxcInstance.Render() in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\SxcInstance_Render.cs:line 29 WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
错误:System.IO.FileLoadException:无法加载文件或程序集
'System.Web.Helpers,版本=2.0.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'
或者它的一个依赖项。找到的程序集的清单定义不匹配
程序集引用。(HRESULT的异常:0x8013100)文件名:
'System.Web.Helpers,版本=2.0.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35'
位于Connect.Dnn.Koi.DnnSkinFile.AutoDetect()处的Connect.Koi.Context.HttpContextState.trytodetectthecsframework()处的
Connect.Koi.Context.HttpContextState.get_cssframew()位于Connect.Koi.Context.ToolsForCurrentState.get_Css()
ASP.上的Connect.Koi.Koi.Is(字符串预期CSS)\页面\门户\ 0 \ 2sxc \教程\剃刀\共享\引导程序P4 \ cshtml.b \ 0(文本编写器\剃刀\助手\编写器)
在c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial Razor\shared\\u bootstrap4.cshtml中:第5行
目标(闭包、调用站点、页面、门户、教程、共享、帮助程序、cshtml、,
文本编写器,对象),位于ASP.\u页面\u门户\u 0\u 2sxc\u教程\u Razor\u共享\u帮助程序\u cshtml.b\u 1e(文本编写器\u Razor\u帮助程序\u编写器)
c:\inetpub\wwwroot\devsite\Portals\0\2sxc\Tutorial Razor\shared\\u helpers.cshtml:System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter编写器,HelperResult内容)第73行
ASP.c:\inetpub\wwwroot\devsite\Portals\0\u2sxc\u教程\u Razor\u共享\uuuhelpers\u cshtml.c\uuuu显示Class1.b\u0(TextWriter\uuuuu Razor\u helper\u writer)中的TextWriter\uuuuuuuuu2sxc\devsite\Portals\0\2sxc\Tutorial Razor\shared\uhelpers.cshtml:第2行
在c:\inetpub\wwwroot\devsite\Portals\0\2sxc\u Tutorial\u Razor\u home\u cshtml.Execute()中的ASP.\u Page\u Portals\u Portals\u 0\2sxc\Tutorial Razor\u home
位于System.Web.WebPages.WebPageBase.ExecutePageHierarchy()的System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext、TextWriter writer、WebPageRenderingBase startPage)
在C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSic_SexyContent\2Sexy Content Razor\RazorEngine.cs:ToSic.SexyContent.Engines.RazorEngine.RenderTemplate()的第65行
在C:\Projects\2sxc-dnn742\Website\DesktopModules\tossic\u SexyContent\2Sexy Content Razor\RazorEngine.cs中:在C:\Projects\2sxc-dnn742\Website\DesktopModules\tossic\u SexyContent\ToSIC.Sxc\SexyContent\Engines\Engines\EngineBase.cs中的第93行
在C:\Projects\2sxc-dnn742\Website\DesktopModules\tossic\u SexyContent\ToSic.Sxc\SexyContent\SxcInstance\u Render.cs中的ToSic.SexyContent.SxcInstance.Render()处,关闭程序集绑定日志记录。要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。

您是否检查了web.config中的类似内容

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>

是的,没有。我将其添加到web配置中,但仍然不走运。我最终安装了aspnetmvc4安装程序,看起来它解决了我的问题。感谢您的回复!