If you run into this error, then it's likely that you're trying to do some form of Umbraco API call in application event handler, or, in some custom code outside of the normal route hi-jacking path. The error basically means the Umbraco context hasn't got far enough into the pipeline to set everything up. In today's tutorial, I'm going to cover some potential resolutions to fix this error.

The Umbraco Helper Vs The ContentTypeService

If you're getting 'GetRootContent Resolution has not frozen' it is likely you're using the wrong API. If you want to talk to Umbraco within a controller, or, a view, then you should use the Umbraco Helper, which looks like this:

The Umbraco Helper is the API you should look at when you want to access other Umbraco stuff within a page, you can do things get the homepage etc...

If you're trying to access Umbraco and you're not in a page context, you should look at 'ContentService' and 'ContentTypeService', you can get access to the API using:

So if you want to get a reference to the homepage, for example, you could use this snippet:

So hopefully, you should see that if you get something like 'GetRootContent Resolution is not frozen' it is likely that you're trying to use the wrong API for the job.

I Really Want To Use The Umbraco Context

If you really want to try and use the Umbraco Context with the Umbraco helper for instance within Custom HttpHandler and you can't use the ApplicationContext for whatever reason, you could always try to manually create the Umbraco context. Umbraco 7.3 Upwards

Umbraco 7.2 Downwards