Reputation: 516
I am trying to do the following in my .cshtml webpage :
@Url.Content("~/")
However, I get the aforementioned error.
The only lead i have is the following: I created a new project to test out what was wrong - in it, @Url
worked fine, so i followed it up (f12). it led to WebViewPage
. many other attributes contained in this class were not available (ViewBag
etc..), so I'm guessing somewhere along the line i broke some config.
Upvotes: 1
Views: 7389
Reputation: 80
I had the same error and I had the <pages pageBaseType="System.Web.Mvc.WebViewPage">
properly seated, and what solved my problem was
C:\Windows\Microsoft.Net\Framework\{Framework Version}\Temporary ASP.NET Files
Upvotes: 4