An error occurred while trying to start a website in IIS: the value cannot be null. Parameter name: key

I am trying to start a website in IIS and get this error. I don't know what the reason is, because this site was created by another person and not me.

Stack trace:

`System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +14370237
   System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +20
   Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.GetLiteralTraceData(LiteralControl literal, TraceData& data) +71
   Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.GetTraceData(Object renderedObject) +220
   Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject) +47
   System.Web.UI.RenderTraceListenerList.EndRendering(TextWriter writer, Object renderedObject) +90
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +12372803
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +331
   System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +114
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +151
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +49
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5363`

      

+4


source to share


3 answers


PageInspector generally takes effect if your server controls are out of date or older. If you are using ASP.NET Server external controls, try updating them.

And if the workaround suits you, you can disable the page inspector like this:



<appSettings>
    <add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
</appSettings>

      

+13


source


Had a similar problem and although @raja nadar's answer fixed it for me, it wasn't the actual cause (or, as it turns out, the true fix).

The question turned out to be:

optimizeCompilations="true"

      

Adding



<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />

      

Killed it into a full recompile where switching false / true fixed the problem on colleagues computer.

I seem to have modified something off-root that was not causing the respective DLLs to be recompiled.

0


source


I faced the same issue in VS2017 Community Edition. Below is an observation. The above post was very helpful to me. This only happens when your visual studio is updated ( https://blogs.msdn.microsoft.com/davidebb/2009/04/15/a-new-flag-to-optimize-asp-net-compilation-behavior/ ) To enable this switch, add it to the compilation section:

<compilation optimizeCompilations="true">

      

Or adding

<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />

      

As mentioned above posts

0


source







All Articles