This fails with a compilation error: 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?)

If I comment that line out and attach a debugger, I can run the exact same line of code in the Immediate window.

If it is a missing reference, I can't figure it out. Theme project has refs to Orchard.Core, Orchard.Framework, and everything from lib\aspnetmvc\*. Maybe I'm missing a dependency of a dependency that I can't untangle?

That extension is in Orchard.Framework so that's probably not the problem. Now that I think of it, this is in Razor views, so the project probably has nothing to do with it. More likely this needs to be set in the local web.config of your views folder.

Nope, it doesn't. Url.Content() returns a relative URL (/OrchardLocal/Themes/...). I'm inserting a meta tag for the Facebook Like image, the image that gets inserted on their wall (og:image, https://developers.facebook.com/docs/reference/plugins/like/).
I learned through trial and error that it requires an absolute URL (http://...).

I had this once (compiling from command line) with a project where I had disabled "copy local" for the Orchard.Framework reference -- but it only failed because I additionally had enabled MvcBuildViews inside the project.

I am getting this same exception when I was setting up email module. Once I installed Email and Messaging I got a warning to install Email.Rules which when I did that it then complained that I needed the Token Module. So after I install the Token module
I get this same exception...

Compilation ErrorDescription: 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")