Reputation: 620
I'm new to ASP.NET MVC and I have inherited a project. I am trying to just publish the site to the staging server so I can test things. I had gotten it to publish successfully, and the site came up fine, but once you log in I get the following error.
Compiler Error Message: CS0433: The type 'System.Web.Mvc.WebViewPage<TModel>' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\06514788\844094e3\assembly\dl3\c0de57de\6523ae3b_4016d001\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've read a bunch of StackOverflows that say that I should remove the <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
line from my web.config file, but that didn't work.
I also tried removing and re-adding the System.Web.Mvc
Reference. But still no luck.
The "Source Error" says public class _Page_Views_Account_SignIn_cshtml : System.Web.Mvc.WebViewPage<Project.Models.LogOnModel> {
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\06514788\844094e3\App_Web_signin.cshtml.5f83eb8c.vy3zmlsz.0.cs Line: 33
So does anyone have any ideas how to fix this error so that when you sign in the site works?
Thanks.
Upvotes: 0
Views: 1433
Reputation: 29186
Two things I would suggest
1) Do not remove the <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
from the web.config
. I've never had to remove that entry in any project I've worked on. So I don't think you should rush to removing it just yet.
2) Instead, you should consider deleting all subfolders that exist under c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
I use a tool CCleaner that has a custom rule to clear all the subfolders in my temp ASP.NET folders. That way you clear out the cruft which might be causing problems with your site.
My hunch is that there might be more to do in order to solve your problem, but let's see how clearing out he folders goes first.
Upvotes: 1