Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complications when upgrading from ASP MVC 3 Preview 1 to beta

I have just upgraded my ASP MVC 3 application from the preview to the beta version. In preview everything worked fine, but as soon as I upgraded weird things started to happen.

I get this error message:

Compiler Error Message: CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\1512250b\962d050c\App_Web_index.cshtml.a8d08dba.kncxiw31.0.cs Line: 19

I have tried to completly rebuild the application, and to clear the temporary asp.net files, but nothing works. My solution builds successfully, no errors while building. But when i try to open the website, I get this error.

These are my referenced dll's:

alt text

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Screenshot of the error message:

alt text

Any thoughts?

like image 781
Martin at Mennt Avatar asked Oct 19 '10 16:10

Martin at Mennt


People also ask

Which framework is best for ASP.NET MVC?

If you are an expert at ASP.NET MVC, you need not to spend time on some other complex frameworks but ASP.NET WEBAPI is the best one for you. It works on the same lines as MVC – though it doesn't have System. Web dependency.

Is ASP.NET MVC outdated?

ASP.NET MVC is no longer in active development.

Can MVC and ASP.NET coexist?

Yes, it is very much possible for MVC pages to coexist with asp.net web forms. I implemented that in my existing asp.net application for adding new features. We need to make sure of referring the MVC DLLs, registering routing tables for URL routing and configuring the assemblies and namespaces in Web. config file.


1 Answers

After intense searching I found some answers in the ASP.NET MVC 3 release notes. There is a section called Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 which tell you what to do:

Add the two following lines into your <assemblies> section in your web.config:

<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, 
     PublicKeyToken=31BF3856AD364E35" />

<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,
     PublicKeyToken=31BF3856AD364E35" />
like image 173
Martin at Mennt Avatar answered Sep 18 '22 15:09

Martin at Mennt