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 20:     //UniformResourceLoader = "localhost:52302/";
Line 21:     dynamic ModuleData = db.QuerySingle("Select * From Modules Where UniformResourceLoader=@0", UniformResourceLoader);
Line 22:     int PageCount = db.QueryValue("Select Count(*) From Pages Where PageName=@0 And ModuleID=@1",PageName,ModuleData.ModuleID);
Line 23:     dynamic ModuleSettings=db.QuerySingle("Select * From ModuleSettings Where ModuleID=@0", ModuleData.ModuleID);
Line 24:     int ActiveTemplateID=ModuleSettings.ActiveTemplateID;

Source File: c:\inetpub\vhosts\unip\htdocs\main.cshtml    Line: 22

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +148
   ASP._Page_main_cshtml.Execute() in c:\inetpub\vhosts\unip\htdocs\main.cshtml:22
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +185
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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