我们刚刚在 DNN 发行版上安装了 2sxc,无法创建基本内容。自定义应用程序加载没有问题,这只发生在内容应用程序中。
将内容模块添加到具有基本内容类型的空白页面会导致以下错误。这是在 DNN 9 和 .NET 4.8 上
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.Koi.Dnn.DetectKoiOfCurrentDnnTheme.AutoDetect()
at Connect.Koi.Context.HttpContextState.TryToDetectTheCssFramework(IDictionary items)
at Connect.Koi.Context.HttpContextState.get_CssFramework()
at Connect.Koi.Dnn.DetectAndCacheDnnThemeCssFramework.AutoDetect()
at Connect.Koi.KoiCss..ctor(Dependencies dependencies)
at lambda_method.lambda_method(Closure , ServiceProviderEngineScope )
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at ToSic.Lib.DI.IServiceProviderExtensions.Build[T](IServiceProvider serviceProvider) in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\DI\IServiceProviderExtensions.cs:line 26
at ToSic.Lib.DI.IServiceProviderExtensions.Build[T](IServiceProvider serviceProvider, ILog parentLog) in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\DI\IServiceProviderExtensions.cs:line 39
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at ToSic.Lib.DI.LazySvc`1.<get_Value>b__5_0() in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\DI\LazySvc.cs:line 48
at ToSic.Lib.HelpersOnce`1.Get.Get(Func`1 generator) in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\Helpers\GetOnce.cs:line 37
at ToSic.Sxc.Images.ImgResizeLinker.ImageOnly(String url, ResizeSettings settings, IHasMetadata field) in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Images\ImgResizeLinker.cs:line 84
at ToSic.Sxc.Images.ResponsiveBase.<get_ThisResize>b__7_0() in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Images\Responsive\ResponsiveBase.cs:line 33
at ToSic.Lib.HelpersOnce`1.Get.Get(Func`1 generator) in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\Helpers\GetOnce.cs:line 37
at ToSic.Sxc.Images.ResponsiveBase.SrcSetGenerator() in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Images\Responsive\ResponsiveBase.cs:line 183
at ToSic.Lib.HelpersOnce`1.Get.Get(Func`1 generator) in C:\Projects\2sxc\eav-server\ToSic.Lib.Core\Helpers\GetOnce.cs:line 37
at ASP._Page_Portals_68_2sxc_Content_bs5_Content_Text_and_Image_Part_Image_cshtml.Execute() in c:\home\site\wwwroot\Portals\68\2sxc\Content\bs5\Content\Text and Image.Part-Image.cshtml🎯:line 31
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
at System.Web.WebPages.HelperResult.ToString()
at System.Web.WebPages.WebPageBase.Write(Object value)
at ASP._Page_Portals_68_2sxc_Content_bs5_Content_Text_and_Image_cshtml.Execute() in c:\home\site\wwwroot\Portals\68\2sxc\Content\bs5\Content\Text and Image.cshtml🎯:line 42
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at ToSic.Sxc.Engines.DnnRazorEngine.Render(TextWriter writer, Object data) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 109
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at ToSic.Sxc.Engines.DnnRazorEngine.Render(TextWriter writer, Object data) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 116
at ToSic.Sxc.Engines.DnnRazorEngine.RenderTemplate(Object data) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 124
at ToSic.Sxc.Engines.EngineBase.Render(Object data) in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Engines\EngineBase.cs:line 178
at ToSic.Sxc.Blocks.BlockBuilder.RenderInternal(Object data) in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Blocks\BlockBuilder_Render.cs:line 134 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].```
事实证明,另一位团队成员更改了 web.config 以添加程序集,但将其放在了错误的位置:
错误:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
/* ... */
</assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</runtime>
</configuration>
已修复:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
/* ... */
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>