I am new to Umbraco but enjoying it however I have a really frustrating problem. I am trying to fire code on the application startup event to register Routes and other things. After building the application and browsing Umbraco CMs everything works fine. Howver when I look at my site it is completely blank and no markup is being rendered in the page source. I am using the ApplicationEventHandler Base class to override the started event but nothing is working. After looking at the event viewer I see the following message:
Process information:
Process ID: 13160
Process name: iisexpress.exe
Account name: MACKIEVISTA\danny
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
Value cannot be null.
Parameter name: umbracoContext
at Umbraco.Web.Mvc.UmbracoController..ctor(UmbracoContext umbracoContext)
at Umbraco.Web.Mvc.UmbracoController..ctor()
at Umbraco.Web.Mvc.RenderMvcController..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
I am using VS2012 Ultimate, Umbraco 7 and building an MVC 4 website using RAZOR. Please can someone help me ou there. I have wasted hour after hour looking at this and can't figure out why the umbracoContext parameter is null and causing this issue. I have looked at all of the articles I can find on this and tried all manner of different approaches but still the same result.
Looks like this may have been a newby mistake. After closer investigation I thought maybe the reason nothing would render was due to my routing table in some way. So I have taken a look and realised that the default MVC route was still being registered as below
As umbraco has it's own routing, my custom route was interfeering with Umbraco' main controller and causing things to fail. I hope this will help some other newbies to the world of Umbraco.
Adding Application Startup code
Hi
I am new to Umbraco but enjoying it however I have a really frustrating problem. I am trying to fire code on the application startup event to register Routes and other things. After building the application and browsing Umbraco CMs everything works fine. Howver when I look at my site it is completely blank and no markup is being rendered in the page source. I am using the ApplicationEventHandler Base class to override the started event but nothing is working. After looking at the event viewer I see the following message:
Process information:
Process ID: 13160
Process name: iisexpress.exe
Account name: MACKIEVISTA\danny
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
Value cannot be null.
Parameter name: umbracoContext
at Umbraco.Web.Mvc.UmbracoController..ctor(UmbracoContext umbracoContext)
at Umbraco.Web.Mvc.UmbracoController..ctor()
at Umbraco.Web.Mvc.RenderMvcController..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
Request information:
Request URL: http://localhost:38324/favicon.ico ;
Request path: /favicon.ico
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: MACKIEVISTA\danny
Thread information:
Thread ID: 10
Thread account name: MACKIEVISTA\danny
Is impersonating: False
Stack trace: at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
Hi All
Looks like this may have been a newby mistake. After closer investigation I thought maybe the reason nothing would render was due to my routing table in some way. So I have taken a look and realised that the default MVC route was still being registered as below
Once I removed my default route and replaced it with my contact controller route everything started to work perfectly.
As umbraco has it's own routing, my custom route was interfeering with Umbraco' main controller and causing things to fail. I hope this will help some other newbies to the world of Umbraco.
Regards
is working on a reply...