0

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.

1
  • Try cleaning the solution by going to Build -> Clean Solution in visual studio. If that doesn't work. Delete obj folder within your solution folder. Commented Mar 2, 2015 at 15:23

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

6 Comments

I cleared those files and now my project is building successfully but is failing when publishing.
And I "Cleaned Solution" and "Cleaned Project"
Looked into the Output window and saw Can't open data connection (425) for a bunch of files, and found that I should change the FTP to Passive... so trying that right now... Let you know how it goes
Ok.. Still failed. Some of the files Say... "Unable to add .... to the Web Site. Filename invalid (550).
I'm not sure what's happening there. Sorry I can't be of more help.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.