How to fix 'Could not load file or assembly &#

2020-04-18 05:33发布

I have a local DNN site and I am trying to use the 2sxc module to create content/apps before placing it on the actual production site. I tried to install the Razor Tutorial App and when I place it on the page I am given following output:

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].

标签: razor 2sxc
1条回答
啃猪蹄的小仙女
2楼-- · 2020-04-18 06:10

Did you check your web.config for something like

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
查看更多
登录 后发表回答