I'm getting the following error when trying to see a page:
Compiler Error Message: CS0433: The type 'System.Web.Mvc.FormMethod' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\1.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\1.1.0.0__31bf3856ad364e35\System.Web.Mvc.dll'
using (Html.BeginForm(MyAction, MyController, FormMethod.Post))
Obviously, a first DLL came with ASP.NET MVC 1.0, while a second came with ASP.NET MVC 1.1. Am I supposed to uninstall ASP.NET MVC 1.0? Will Visual Studio 2008 continue to work with MVC applications after uninstallation of MVC 1.0 and will it pick MVC 1.1?
In your VS2010 project, does the reference to System.Web.Mvc (right click, properties on the assembly) point to Program Files\Microsoft ASP.NET\ASP.NET MVC 1.1\Assemblies?
If your project references 1.1 but you're consuming components which reference 1.0 (say, MvcContrib), then you'll need to use a Binding Redirect in your Web.config file to ensure that everybody linked against 1.0 is actually using 1.1. Unlike the system
assemblies built into .NET, there is no 'automatic version upgrading' happening for System.Web.Mvc.dll.
Marked as answer by vkelman on Jun 16, 2009 05:10 AM
Thank you, everybody! I don't use MvcContrib, but I'm using Futures library. Also, I converted existing example from
ASP.NET MVC Quickly to VS 2010. For one of these reasons it was referencing 1.0. Adding Binding Redirect resolved this issue.
vkelman
Member
50 Points
35 Posts
Can VS 2008 + ASP.NET MVC 1.0 and VS 2010 and ASP.NET MVC for VS 2010 work side by side?
Jun 15, 2009 04:03 AM|LINK
I had VS 2008 and ASP.NET MVC 1.0 working on my machine. Then I installed VS 2010 Beta 1 and ASP.NET MVC 1.1
Now, when I try to compile a simple application which includes the following in a View:
<% using (Html.BeginForm(MyAction, MyController, FormMethod.Post)) { %> . . . <% } %>I'm getting the following error when trying to see a page:
Compiler Error Message: CS0433: The type 'System.Web.Mvc.FormMethod' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\1.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\1.1.0.0__31bf3856ad364e35\System.Web.Mvc.dll' using (Html.BeginForm(MyAction, MyController, FormMethod.Post))
Obviously, a first DLL came with ASP.NET MVC 1.0, while a second came with ASP.NET MVC 1.1. Am I supposed to uninstall ASP.NET MVC 1.0? Will Visual Studio 2008 continue to work with MVC applications after uninstallation of MVC 1.0 and will it pick MVC 1.1?
Thanks
http://pro-thoughts.blogspot.com/
jeloff
Contributor
2493 Points
432 Posts
Microsoft
Re: Can VS 2008 + ASP.NET MVC 1.0 and VS 2010 and ASP.NET MVC for VS 2010 work side by side?
Jun 15, 2009 03:57 PM|LINK
Hi
In your VS2010 project, does the reference to System.Web.Mvc (right click, properties on the assembly) point to Program Files\Microsoft ASP.NET\ASP.NET MVC 1.1\Assemblies?
You shouldn't need to uninstall MVC 1.0
Jacques
bradwils
Contributor
5779 Points
691 Posts
Microsoft
Re: Can VS 2008 + ASP.NET MVC 1.0 and VS 2010 and ASP.NET MVC for VS 2010 work side by side?
Jun 15, 2009 06:58 PM|LINK
Something else to consider...
If your project references 1.1 but you're consuming components which reference 1.0 (say, MvcContrib), then you'll need to use a Binding Redirect in your Web.config file to ensure that everybody linked against 1.0 is actually using 1.1. Unlike the system assemblies built into .NET, there is no 'automatic version upgrading' happening for System.Web.Mvc.dll.
vkelman
Member
50 Points
35 Posts
Re: Can VS 2008 + ASP.NET MVC 1.0 and VS 2010 and ASP.NET MVC for VS 2010 work side by side?
Jun 16, 2009 05:10 AM|LINK
http://pro-thoughts.blogspot.com/