I just installed the Tag Manager package on an Umbraco 7.2.1 project and am getting the following error when I hit the Tag Manager tab:
Received an error from the server
Failed to retrieve data for application tree TagManager
Object reference not set to an instance of an object.
EXCEPTION DETAILS:
System.NullReferenceException: Object reference not set to an instance of an object.
STACKTRACE:
at Umbraco.Web.Trees.ApplicationTreeExtensions.TryLoadFromControllerTree(ApplicationTree appTree, String id, FormDataCollection formCollection, HttpControllerContext controllerContext)
at Umbraco.Web.Trees.ApplicationTreeController.<GetRootForSingleAppTree>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Umbraco.Web.Trees.ApplicationTreeController.<GetApplicationTrees>d__4.MoveNext()
I googled around and found forum posts from about a year ago which could likely be the source of this issue: here and here - this project does use Autofac (although a relatively old version - 3.1) and so this could possibly be a similar issue. It turns out that the Web Api dependency resolver was not set up correctly; when I fixed that issue, I was able to write a test UmbracoApiController and confirmed that that was working.
However the Tag Manager package continues to throw up the same exception as above!
Sorry for asking but you have tags within your site ?
Other than that I simply have no idea what the issue might be - I know I haven't tested the tag manager package on a site with no tags, so hence the suggestion.
I've figured this problem out; as it turns out for projects that are built using Autofac, you need to manually register web API controllers for specific packages that are added. I got TagManager to work by adding this to my Autofac registration code:
Web API fail causes TryLoadFromControllerTree to fail
Hello
I just installed the Tag Manager package on an Umbraco 7.2.1 project and am getting the following error when I hit the Tag Manager tab:
Received an error from the server Failed to retrieve data for application tree TagManager
I googled around and found forum posts from about a year ago which could likely be the source of this issue: here and here - this project does use Autofac (although a relatively old version - 3.1) and so this could possibly be a similar issue. It turns out that the Web Api dependency resolver was not set up correctly; when I fixed that issue, I was able to write a test UmbracoApiController and confirmed that that was working.
However the Tag Manager package continues to throw up the same exception as above!
Any ideas what could be causing this?
Hi Joseph
Sorry for asking but you have tags within your site ?
Other than that I simply have no idea what the issue might be - I know I haven't tested the tag manager package on a site with no tags, so hence the suggestion.
Cheers
Nigel
Hello Nigel
I've just checked - the site does have tags in it.
I'll try posting this question on the general forum to see if I can get any general guidance around Umbraco's use of Web API.
cheers Joseph
Hi Joseph
Another thought... Is the site a clean install, or has it been upgraded. Just wondering if there are any legacy DLL's that may be causing issues ?
Cheers
Nigel
Hi Nigel
This site has been upgraded from 6.1 so it could be related. Any specific DLLs I should check for?
cheers Joseph
I've figured this problem out; as it turns out for projects that are built using Autofac, you need to manually register web API controllers for specific packages that are added. I got TagManager to work by adding this to my Autofac registration code:
belated thanks but you just solved my issue, i am using autofac with this package and was getting same error.
is working on a reply...