Server Error in '/' Application.

Cannot perform runtime binding on a null reference

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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference

Source Error:


Line 145:        }
Line 146:		
Line 147:		if(App.HostName != null && ProductId != null && ProductDetail.Description != null) {
Line 148:			CanonicalURL = "http://" + App.HostName + "/store/" + HttpUtility.UrlEncode(ProductId) + "/" + HttpUtility.UrlEncode(ProductDetail.Description);
Line 149:		}

Source File: c:\Inetpub\wwwroot\_PageStart.cshtml    Line: 147

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +124
   System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +4197732
   CallSite.Target(Closure , CallSite , Object ) +222
   ASP._Page__PageStart_cshtml.Execute() in c:\Inetpub\wwwroot\_PageStart.cshtml:147
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +49
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +121


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1025