Take the 2-minute tour ×

I'm having an issue with my ASP.Net MVC application, I'm using MVC 3 with Razor, and I cannot use the Raw extension method.

This is the error I get:

CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Raw'
and no extension method 'Raw' accepting a first argument of type
'System.Web.Mvc.HtmlHelper' could be found.

I verified and the MVC dll version is 3.0, the target framework for the project is 4, I just have no idea of what is going on.

I even tried creating a new MVC 3 project from scratch but it doesn't work either.


This is the code I'm using for my Index.cshtml view on the test project (just a new ASP.NET MVC 3 project):

    View.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";



The error is exactly the same described above.

Any ideas? thanks

share|improve this question
Can you post some of your code? The error message is helpful, but we can't really help without seeing some code. –  Kyle Trauberman May 14 '11 at 22:43
add comment

1 Answer

up vote 1 down vote accepted

Finally fixed the issue.

I just went to http://www.asp.net/mvc and downloaded the standalone installer of MVC3, apparently there was something wrong with the version I was using (I installed it using WPI).

Now everything works as expected (including the ViewBag that wasn't working).

share|improve this answer
Mark this as the answer. –  Jonathan May 29 '13 at 7:12
I installed the Asp Net MVC 3 Tools Update which resolved the issue. –  Jonathan May 29 '13 at 8:42
add comment

Your Answer


