C# – ‘System.Web.Mvc.HtmlHelper’ does not contain a definition for ‘RenderPartial’ – ASP.Net MVC

asp.net-mvcc

I've been trying to run ASP.Net MVC 1.0 on one machine, but can't get past this. I create a new MVC project (C#). It creates all the folders, views, controllers, models etc. All good. Then, when I hit F5, I get the following:

d:\VSCode2008\MVC\MvcApplication1\Views\Shared\Site.Master(19): error CS0117: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial'

this happens at the following line:

httpHandler.ProcessRequest(HttpContext.Current); in Default.aspx.cs

It seems when it is trying to do a RenderPartial() to render the logon partial.

I have version 3.51 of .Net framework installed. I installed version 1.0 of MVC, and the assembly clearly has RenderPartial() as extension methods of HtmlHelper.

Anyone seen anything similar? I have found some posts about similar problems with betas and RCs but the suggested fixes have not woredk.

I am loving the theory of MVC but it is not letting me play!

Best Answer

Just trying to rule out the obvious here, but can you make sure have this in the namespaces section of the web.config?

<add namespace="System.Web.Mvc.Html"/>