the problem is that default Umbraco installation lacks the ClientDependency.Core.Mvc.dll file. This can be obtained from the ClientDependency hompage. But you will have problems with references, as the assembly ClientDependency.Core.Mvc.dll references System.Web.MVC v4.0.0.0, where Umbraco has only v3.0.0.0. The solution for me was that I donwloaded the CD source and recompiled the ClientDependency.Core.Mvc project with reference to System.Web.MVC.dll in my Umbraco bin directory.
he Pavel, thanks for your reply. I recompilled the MVC source to match the umbraco MVC version (actually it referenced mvc2, not 4). Placed both dll's in my bin but still no luck. Same error as above. Anything special you're doing to register/render your css/js files in cshtml?
it's not the RenderCssHere that is outputting the namespaces it is the RequireCss and RequireJs that do that. Adding @Html.Raw around thouse doesn't help.
ClientDependency with 4.11.1
I tried getting ClientDependency working with the Mvc Renderer. Added mvc section in ClientDependency.config as per http://clientdependency.codeplex.com/wikipage?title=Configuration&referringTitle=Documentation but still getting error
'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' does not contain a definition for 'RenderJsHere....
when trying to render (or register) js / css files.
Does anybody know what piece of code will register the method to the Html helper in razor?
Hi Yannick,
the problem is that default Umbraco installation lacks the ClientDependency.Core.Mvc.dll file. This can be obtained from the ClientDependency hompage. But you will have problems with references, as the assembly ClientDependency.Core.Mvc.dll references System.Web.MVC v4.0.0.0, where Umbraco has only v3.0.0.0. The solution for me was that I donwloaded the CD source and recompiled the ClientDependency.Core.Mvc project with reference to System.Web.MVC.dll in my Umbraco bin directory.
This was already pointed out in the Umbraco issue tracker.
Pavel
he Pavel, thanks for your reply. I recompilled the MVC source to match the umbraco MVC version (actually it referenced mvc2, not 4). Placed both dll's in my bin but still no luck. Same error as above. Anything special you're doing to register/render your css/js files in cshtml?
Ah, I forgot, you also have to add @using ClientDependency.Core.Mvc to your view (that's where the extension method RenderJsHere is defined)...
Great that seems to work! Can't see how I forgot to add that using statement.
Now only for every call to RequireCss or RequireJs it is outputting:
System.Web.Mvc.HtmlHelper`1[Umbraco.Web.Models.RenderModel]
Any idea how to prevent that?
Sorry for splitting the answer into pieces, but this should really be the last one to make the puzzle complete :-)
it's not the RenderCssHere that is outputting the namespaces it is the RequireCss and RequireJs that do that. Adding @Html.Raw around thouse doesn't help.
OK, I forgot. You have to put the RequireCss into the view code. E.g.
wonderful, finally everything working now! Was quite a challenge. Hope this thread will serve many others to work out the details.
This worked a treat for me in Umbraco 4.11.6, thanks! :D
Perfect..
is working on a reply...