Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type 'System.Web.IHtmlString' is defined in an assembly that is not referenced

Little lost right now...

I am following the following article to test/learn nested layouts. http://blogs.msdn.com/b/marcinon/archive/2010/12/15/razor-nested-layouts-and-redefined-sections.aspx

And i am getting the following error:

The type 'System.Web.IHtmlString' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. D:\Projects\Mvc3\Tests\RazorLayouts\Layout.MvcBase\Extensions\SectionExtensions.cs 15 36 Layout.MvcBase

I have name space System.Web referenced... and the blue line is on "RenderSection". public static HelperResult RenderSection

like image 260
learning... Avatar asked May 02 '11 04:05

learning...


Video Answer


1 Answers

I just had this issue. You may need to add a reference to "System.Web" as well. That fixed it for me. Remember, not just the "using" statement, but actually adding a reference to it. I ran into this issue while setting up a test project for my controllers.

like image 95
JebaDaHut Avatar answered Sep 21 '22 09:09

JebaDaHut