Exception 'System.Web.Mvc.UrlHelper' does not contain a definition for 'MakeAbsolute' when I attempt to install the Token Module

Topics: Troubleshooting
Oct 24, 2011 at 2:46 AM

I was attempting to setup Email messaging and after installing Messaging, Email, Rules it wants me to install Tokens but ever time I try to install tokens I get the following runtime compiliation error..


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'MakeAbsolute' and no extension method 'MakeAbsolute' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 83: 
Line 84:             context.For<string>("Url")
Line 85:                 .Token("Absolute", url => new UrlHelper(_workContextAccessor.GetContext().HttpContext.Request.RequestContext).MakeAbsolute(url));
Line 86: 
Line 87:             context.For<TextField>("TextField")

Source File: e:\web\softland\Modules\Orchard.Tokens\Providers\ContentTokens.cs Line: 85

Oct 24, 2011 at 3:15 AM

My guess would be that you are running Orchard 1.2 and attempting to run 1.3 versions of those modules on it.

Oct 24, 2011 at 10:18 AM
Edited Oct 24, 2011 at 10:18 AM

@bertrandleroy: You get a notification message from the gallery that these modules are ready to be updated, even on 1.2, which can confuse many people. I think there should be some mechanism to check the dependency on the version of Orchard.Framework at least. This also makes me think whether it's possible to add version information to dependencies.

Oct 25, 2011 at 9:16 AM

Yes, we know. Feel like implementing it? ;)

Oct 25, 2011 at 12:55 PM

@bertrandleroy: OK, I'll see if I can spare some time for it this weekend.