Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC 4 Can't fix the error The type 'System.Web.Mvc.WebViewPage <TModel> exists in the elements

after moved my MVC 4 project from VS 2012 to VS 2013 Community I get the following error (in the LogIn.cshtml page).

CS0433: The type 'System.Web.Mvc.WebViewPage "exists in the elements c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Mvc\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll and c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Mvc\v4.0_3.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll

I deleted all files from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files, cleaned the solution but the problem remains. How to fix it ?

EDIT

The Test project used the MVC 3, that was the reason

like image 506
Tony Avatar asked Dec 20 '22 08:12

Tony


1 Answers

If you have already tried the above solutions and are still getting the same problem then try this one-> Go to your project folder and in there locate the bin folder --> Remove System.Web.Mvc.dll and System.Web.Mvc.xml from there.

like image 62
Krishna Avatar answered Jan 22 '23 20:01

Krishna