NiceUrl always returns # when mocking a UmbracoContext
Hello
I'm currently having a hard time getting the NiceUrl of a node retrieved through the ContentService, while in a scope where HttpContext and UmbracoContext is null. Therefore I've mocked an HttpContext and a UmbracoContext to solve this issue, but now I'm just getting # as url for all nodes.
UrlProvider wants the complete cache available, which means if you're mocking... a good deal of things need to be made available. If you have the Umbraco source, you can look at what's in Umbraco.Web.Standalone...
I see. I guess you're referring to InitializeResolvers method in the StandaloneBootManger.cs (https://github.com/umbraco/Umbraco-CMS/blob/6.2.0/src/Umbraco.Web/Standalone/StandaloneBootManager.cs).
I'm just hitting a wall here, since all of the constructors that I should be using is marked as internal. Is this an incorrect observation or? :-)
Alright, problem was that we we're running in a loadbalanced environment and the xmlcache wasn't correctly in sync, so the Umbraco.EnsureContext() works fine.
NiceUrl always returns # when mocking a UmbracoContext
Hello
I'm currently having a hard time getting the NiceUrl of a node retrieved through the ContentService, while in a scope where HttpContext and UmbracoContext is null. Therefore I've mocked an HttpContext and a UmbracoContext to solve this issue, but now I'm just getting # as url for all nodes.
Any suggestions? :-)
Kind regards
UrlProvider wants the complete cache available, which means if you're mocking... a good deal of things need to be made available. If you have the Umbraco source, you can look at what's in Umbraco.Web.Standalone...
Thanks, giving it a try :-)
I see. I guess you're referring to InitializeResolvers method in the StandaloneBootManger.cs (https://github.com/umbraco/Umbraco-CMS/blob/6.2.0/src/Umbraco.Web/Standalone/StandaloneBootManager.cs).
I'm just hitting a wall here, since all of the constructors that I should be using is marked as internal. Is this an incorrect observation or? :-)
Kind regards.
Alright, problem was that we we're running in a loadbalanced environment and the xmlcache wasn't correctly in sync, so the Umbraco.EnsureContext() works fine.
Thanks for the help Stephen :-)
is working on a reply...