If you are upgrading the DNN from 07.03.02 to Version 09.XX.XX and post upgrade you are getting the following error
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
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:
DotNetNuke.Web.Mvc.MvcHttpModule.SuppressXFrameOptionsHeaderIfPresentInConfig() +327
DotNetNuke.Web.Mvc.MvcHttpModule.Init(HttpApplication context) +13
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +579
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +164
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +266
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +340
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
Then one of the reason can be that <customHeaders> tag is not correct in the web.config. If it looks something like following then it is not correct.
<httpProtocol>
<customHeaders>
<clear />
<remove name="X-XSS-Protection" />
<remove name="X-Frame-Options" />
<add name="X-XSS-Protection" value="1; mode=block" />
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
Replace it with following <customHeaders>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
This will do the trick. I hope this helps.