Troubleshooting loading site during debug session in VS:

Matthew Stone asked on October 25, 2024 00:41

Similar to another topic I just submitted. We got this project code from my client's old vender and we need to make sure everything is there before cutting ties completely.

When I am trying to see if the site even loads from Visual Studio, I am getting errors as well.

This is the error I am getting: CMS.Core.pdb not loaded CMS.Core.pdb contains the debug information required to find the source for the module CMS.Core.dll

And the detailed message here: CMS.Core.ServiceResolutionException HResult=0x80131500 Message=Resolution of 'CMS.Core.IEventLogContextAccessor' failed with the following error: Cannot access a disposed object. Object name: 'IServiceProvider'. Source=CMS.Core StackTrace: at CMS.Core.IoCContainer.ResolveTService at CMS.Core.Service.ResolveTService at CMS.Base.CMSThread.Run() at System.Threading.Thread.StartCallback()

This exception was originally thrown at this call stack: Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(System.Type) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(System.IServiceProvider, System.Type) Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService

Recent Answers


Laura Frese answered on November 5, 2024 21:55

check and see if you are missing some DLLS. To help you determine this you can try installing a new Kentico13 version form the Kentico website or using the Kentico Installer and just go thru the setup process to install a demo site. If applicable, make sure that you also install the hotfix up to your clients site version, then compare the dlls to ensure none are missing

0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on November 7, 2024 18:38

Hi Matthew! I think the answer on the other question you posted will help you here. If you like my answer please upvote or mark as correct :)

can you change your environment variable on your local to Production? In development envt default service provider performs checks to verify that:

  • Scoped services aren't resolved from the root service provider.
  • Scoped services aren't injected into singletons.

This check is not performed on production so it does not throw the error on higher envts. However, this is still a problem that indicates that things were not set up properly. Fixing it on your local will only be an improvement. Because the way its set up now can result in multi threading issues and memory leaks.

This might help with proper refactoring. https://stackoverflow.com/questions/55089755/cannot-resolve-scoped-service

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.