【问题标题】:Server Error in '/' Application after build solution in Visual Studio在 Visual Studio 中构建解决方案后“/”应用程序中的服务器错误
【发布时间】:2021-10-12 02:59:32
【问题描述】:

我正在尝试将我的项目与 Sitecore 数据库同步,但是当我构建由 Sitecore Learning(服装公司)提供的解决方案时,我的网站未加载并出现错误。在我尝试构建它之前它运行良好。

`Server Error in '/' Application.
Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[TypeLoadException: Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   Sitecore.ContentSearch.SolrProvider.DependencyInjection.ContentSearchServicesConfigurator.AddContentSearchHealthChecks(IServiceCollection serviceCollection) +0
   Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
   Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
   Sitecore.DependencyInjection.BaseServiceProviderBuilder.ConfigureServiceCollection() +142
   Sitecore.DependencyInjection.ServiceLocator.ConfigureServiceProvider() +225
   Sitecore.DependencyInjection.ServiceLocator.get_ServiceProvider() +513
   Sitecore.DependencyInjection.SitecorePerRequestScopeModule..ctor() +13

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +142
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +234
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1153
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +139
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724`

【问题讨论】:

    标签: visual-studio sitecore tds


    【解决方案1】:

    查看错误,您的网站 bin 中的 Sitecore.Kernel.dll 似乎被替换为不同的版本,或者您的 web.config 文件被替换,这可能具有不同的 Sitecore.kernel.dll 程序集绑定版本信息。

    我建议,在 dotpeek 中检查您原始网站 bin 中的 Sitecore.kernel.dll 版本。 通过 Nuget 管理器在您的项目解决方案中更新此版本的 Sitecore.kernel.dll,或在您的托管 lib 文件夹或 DLL 位置文件夹中更新您的 DLL。

    如果您有,请将解决方案 web.config 中的程序集绑定信息与原始 web.config 中的相同。

    如果两个地方的 DLL 版本已经相同,则在 dotpeek 中加载 Sitecore.kernel.dll,检查类 Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder 是否存在。如果没有,则某些配置文件包含此类的条目。在 App_config 文件夹文件中搜索单词 HealthChecksBuilder,并评论您找到的设置并查看该站点是否已启动。

    然后 VS 发布希望问题得到解决。

    【讨论】:

      猜你喜欢
      • 2016-01-18
      • 1970-01-01
      • 1970-01-01
      • 2021-10-13
      • 1970-01-01
      • 2011-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多