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

A little lost right now ...

I follow the next article to check / examine nested layouts. http://blogs.msdn.com/b/marcinon/archive/2010/12/15/razor-nested-layouts-and-redefined-sections.aspx

And I get 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 a System.Web namespace referenced ... and the blue line is on the "RenderSection". public static HelperResult RenderSection

+3
source share
3 answers

. , " System.Web". . , "using", . .

+3

, (, 3.5 System.Web), - -, .

, zip ( , ​​ API, ..), ?

: - , System.Web. , System.Web. , , (, System.Web.Mvc) . , " " "System.Web".

+1

I had the same problem. I added the System.Web assembly, but not from the add link. I double-clicked on one assembly in the help folder and opened a new tab, here I selected the correct version of .net, and I added the specific version of the assembly, and everything works correctly. In my case, I am using .net 4.0. I hope to help you.

0
source

All Articles