title: Errors adding module after ugrade to 2sxc 9.0.2
body: <p>Hi just starting using 2scx a few week and loving it until this morning when I upgraded to 9.0.2 from 9.0.0</p>
  
  <p>Install seemed to go clean but after the upgrade whenever I try to add a content block to the page I'm getting errors when I attempt to set the Content/Template.</p>
  
  <p>I get a popup: 
  <a href="https://i.stack.imgur.com/b4Cwb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b4Cwb.jpg" alt="400 Eror"></a>
  Other maybe relevant info:</p>
  
  <ul>
  <li><p>Running DNN 9.1</p>
  
  <p>Tried stock Data and Templates DOES NOT WORK</p>
  
  <p>Adding Apps DOES work</p>
  
  <p>Porto 3 Skin but I've tried gravity as well</p>
  
  <p>Tried with and without SSL</p>
  
  <p>Existing Modules are still working.</p></li>
  <li><p>Tried different pages</p></li>
  <li><p>Tried Different Permissions</p></li>
  <li><p>Tried Different User Type Admin vs Host</p>
  
  <p>Thanks for any insights you can provide.</p></li>
  </ul>
  
  <p>Michael</p>
  
  <hr>
  
  <h2>Debug info is below:</h2>
  
  <p>Heres the header</p>
  
  <pre><code>Request URL:http://www.mdrealtor.org/API/2sxc/view/module/savetemplateid?templateId=0&amp;forceCreateContentGroup=false&amp;newTemplateChooserState=false
  
  Request Method:GET Status Code:400 Bad Request Remote Address:173.192.224.24:80 Referrer Policy:no-referrer-when-downgrade Response Headers view source Cache-Control:no-cache Content-Length:3937 Content-Type:application/json; charset=utf-8 Date:Wed, 17 May 2017 17:01:00 GMT Expires:-1 Pragma:no-cache Set-Cookie:dnn_IsMobile=False; path=/; HttpOnly Request Headers view source Accept:application/json, text/javascript, /; q=0.01 Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Type:application/json ContentBlockId:1065 Cookie:.ASPXANONYMOUS=18TV3gwv_7q6D_39UQH-jI9O_XN5Nexk8ZN9qvdLu9yFqIT26As0sb88Gg2wLnFTR_T5sR98ICbeJd1HjjDEYUDodaZ_4oiDW3jNwnxm_pL_al5L0; __RequestVerificationToken=fCM4lTLzvJU72120V2yigIykkJ73I_o6ZWbfDnsdzD1QoE5cCFPvw6K5bUdB1Q33P3W1GQ2; ASP.NET_SessionId=srt2ktkzgwxqny21eekoq0lr; dnn_ctr993_Actions_VerticalTabs=2; USERNAME_CHANGED=; authentication=DNN; .DOTNETNUKE=8BD9888218CE7FDB2EF22F44FC3AFC63C1D49232A83394E02D63DE6B6121C7A031EE44A8207940395F3924396CE90B44AAF2DB6EC9B90DEC7E3D799E35A2F42406614903CEAFBEB6B5BB02555CB44BCCB02289C268016B59437BA6FB; __atuvc=3%7C19; dmxdavcookie=24A5B95D15CF49E9B4C3D4B5524232529C99738FA78E7AB59726E84E142CD3BEE0042FF35D17792FB5A62351D8D4220B7A015A5DFC6123303FF359FDE8E8F169FC89ABEFA894B923D32D652321C30EDB1746E084ADB3F9FE33051E0C68DA809A4E9DA26DCF4536A158B10F90BFFD16229443C8A1; __utmt=1; __utma=246747480.1370016723.1494432445.1495032237.1495034375.9; __utmb=246747480.43.10.1495034375; __utmc=246747480; __utmz=246747480.1494432445.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); language=en-US; LastPageId=0:387; dnn_IsMobile=False Host:www.mdrealtor.org ModuleId:1065 Referer:http://www.mdrealtor.org/Association/Test RequestVerificationToken:pV9nTyH5MFcHdwU6Oc29dme3RdyJ3IQefrIm5p6hGORjWYPt1gzGDIVvx42UU2mLFlsQxvDMPpPSBwb2fbd7MedT-3s1 TabId:387 User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 X-Requested-With:XMLHttpRequest Query String Parameters view source view URL encoded templateId:0 forceCreateContentGroup:false newTemplateChooserState:false
  </code></pre>
  
  <p>And the response</p>
  
  <pre><code>{"Message":"Bad Request","ExceptionMessage":"The given key was not present in the dictionary.","ExceptionType":"System.Collections.Generic.KeyNotFoundException","StackTrace":"   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n   at ToSic.SexyContent.ContentBlocks.ContentGroupReferenceManagerBase.SaveTemplateId(Int32 templateId, Boolean forceCreateContentGroup, Nullable`1 newTemplateChooserState) in C:\\Projects\\2SexyContent\\Web\\DesktopModules\\ToSIC_SexyContent\\SexyContent\\ContentBlocks\\ContentGroupReferenceManagerBase.cs:line 55\r\n   at ToSic.SexyContent.WebApi.View.ModuleController.SaveTemplateId(Int32 templateId, Boolean forceCreateContentGroup, Nullable`1 newTemplateChooserState) in C:\\Projects\\2SexyContent\\Web\\DesktopModules\\ToSIC_SexyContent\\Sxc WebApi\\View\\ModuleController.cs:line 38\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;&gt;c__DisplayClass10.&lt;GetExecutor&gt;b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Tracing.ITraceWriterExtensions.&lt;TraceBeginEndAsyncCore&gt;d__18`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.&lt;InvokeActionAsyncCore&gt;d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Tracing.ITraceWriterExtensions.&lt;TraceBeginEndAsyncCore&gt;d__18`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.&lt;ExecuteAsync&gt;d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.&lt;ExecuteAuthorizationFilterAsyncCore&gt;d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.&lt;ExecuteAuthorizationFilterAsyncCore&gt;d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.&lt;ExecuteAsync&gt;d__0.MoveNext()"}
  </code></pre>
  
  <p>No errors in DNN log file.</p>