That was probably because I downloaded the project of the book from internet which had older version of razor, and after I created an area in that project it couldn't cast it to the latest version of razor(i'm guessing) as the warning as in visual studio says:
Warning 1 D:\Tutorial\mvc4ia-2012-06-
13\src4\Chapter13\AreasExample\Areas\foo\Views\Foo\Index.cshtml: ASP.NET runtime error:
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to
[B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from
'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf385
6ad364e35\System.Web.WebPages.Razor.dll'.
Type B originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf385
6ad364e35\System.Web.WebPages.Razor.dll'. D:\Tutorial\mvc4ia-2012-06-
13\src4\Chapter13\AreasExample\Areas\foo\Views\Foo\Index.cshtml AreasExample