Null reference when deploying starter site

Topics: General
Oct 4, 2011 at 12:45 PM


C1 2.1.3. build 9083

Running in Visual Studio - OK.

Deploying to server:

Server Error in '/' Application.

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: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Composite.Core.Routing.Pages.C1PageRouteHandler..cctor() +302

[TypeInitializationException: The type initializer for 'Composite.Core.Routing.Pages.C1PageRouteHandler' threw an exception.]
   Composite.Core.Routing.Pages.C1PageRouteHandler..ctor() +0
   Composite.Core.Routing.Pages.C1PageRoute.GetRouteData() +50
   Composite.Core.Routing.Pages.C1PageRoute.GetRouteData(HttpContextBase context) +1581
   System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +287
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60
   System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +86
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

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


any ideas?





Oct 4, 2011 at 12:58 PM

Likely you have something "unexpected" in web.config, in Visual Studio runs site in "classic" mode, and server's IIS in "integrated" - a different section from web.config was used and that leaded to the exception you see.

Suggested solution: Replace Composite.dll & Composite.Workflows.dll with debug versions and than it should be obvious which code line causing the problem.

Oct 4, 2011 at 9:08 PM


We are "packaging" integration of 960gs css framework (fixed and fluid) into Composite C1 and in 2 flavors
nonoptimized  and optimized for pagespeed (currently based on Layout templates, but moving tonite
to XSLT functions. 

C1 versions

With 2.1 we have to rewrite bunch of html and add aspx extensions in urls of anchor links in 960gs 
original html. This will probably wait. 

So as the showcase idea was to run C1 pages (aspx) side by side with static original pagest index.html.

I have tried to make those static pages/or entering dirs in url "automatic" so I added:

				<add value="index.html" />

 into web.config. Interestingly in VS no problems, local IIS has pointed out, but when copied to "production" got
message from above - even in browser locally on server!
On my dev machine iis server has correctly pointed out error in web.config.


But never mind. It is solved and have learned this trick with debug versions.