I am having issues with the connection of Sitecore after I tried to connect VS Studio 2019. The Solr is running and my server seems fine. Sitecore was running just fine until I tried to build a connection into Sitecore using VS Studio. I copied the web.config and global.asax, Sitecore files into my vs code solution and built them onto the root web folder and that's when everything crashed.

Value cannot be null. Parameter name: sessionStateBehaviorResolver

[ArgumentNullException: Value cannot be null. Parameter name: sessionStateBehaviorResolver]    Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName) +64    Sitecore.Owin.Extensions.AppBuilderExtensions.SetSessionStateBehaviorResolver(IAppBuilder app, SessionStateBehaviorResolver sessionStateBehaviorResolver) +54    Sitecore.Owin.Startup.Configuration(IAppBuilder app) +28

[TargetInvocationException: Exception has been thrown by the target of an invocation.]    System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +132    System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+146    Owin.Loader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder) +93    Owin.Loader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder) +224    Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +900    Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +51  Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
+101    System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
+139    Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +160    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +587    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +255    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+122    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737```
  • Can you provide more clarification on this? How you are creating a connection between VS Studio and Sitecore. Do you want to use Sitecore Rocks by using this? Or anything else you are trying? Apr 27, 2022 at 15:40
  • Yes, I used Sitecore rocks to build the connection and once the solution was published that's when Sitecore crash. I followed Sitecore's documentation for this instance doc.sitecore.com/xp/en/developers/93/… Apr 27, 2022 at 15:53

1 Answer 1


So the document you are following is stating that you don't need to copy or publish your Web.Config to your Sitecore instance. See this as given in the document.


This is given in the section under the Set up a Visual Studio Project and point 4.

The Web.config file in the Visual Studio project is quite minimal, while the Web.config file in the Sitecore instance contains important settings. This step is to avoid that the file from Visual Studio overwrites the one in Sitecore when you publish.

In Visual Studio, in the Solution Explorer, right-click the Web.config file in the root of the project, and select Properties. Set the Build Action property to None and the Copy to Output Directory property to Do not copy

So revert your Web.Config changes in the Sitecore and then try again.

Hope this helps.

  • Hi Sumit,, looking at the Web.config now and yes, I s what happended and the Web.config file was overwritten. Do you know how am I ablle to revert the web.config file? Thank you in advance Apr 27, 2022 at 17:21
  • Yes, you can get the web.config from your Sitecore Vanilla instance or we can say, extract your Sitecore package i.e. "Sitecore 9.3.0 rev. 003498 (Setup XP0 Developer Workstation rev. 1.1.1-r4)" and open the folder and again extract "Sitecore 9.3.0 rev. 003498 (OnPrem)_single.scwdp", open folder and you will find the Sitecore instance. Get the config from there and use. Hope you like this. Apr 28, 2022 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.