Fenton
Fenton

Reputation: 250932

ASP.NET MVC 2 System.Web.Mvc.dll conflict

I have installed the ASP.NET MVC 2 RC and opened the default "example project", but get the following error:

Parser Error Message: The type 'System.Web.Mvc.ViewMasterPage' is ambiguous: it could come from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' or from assembly 'C:\Documents and Settings\sfent\My Documents\Visual Studio 2008\Projects\MvcApplication1\MvcApplication1\bin\System.Web.Mvc.DLL'. Please specify the assembly explicitly in the type name.

This appears to be a conflict between the GAC dll and the dll created and placed in the bin directory (which I thought was supposed to be used in preference to the GAC version)

I have Googled this issue and have found similar problems, but relating to incorrect namespacing. This is the un-altered example application that comes bundled with the MVC framework.

I have also tried removing the framework entirely and re-installing the RC, but to no avail.

All suggestions appreciated.

Upvotes: 2

Views: 7599

Answers (3)

Damrod
Damrod

Reputation: 19

the problem might be that the Reference in your Project is still pointing to the old Version of the dll (v1.0). Delete the reference and add a new one to version (v2.0).

You find that hint as well in the release notes of MVC2 RC:

"Open the project using Visual Studio, and in Solution Explorer, expand the References node. Delete the reference to System.Web.Mvc (which points to the version 1.0 assembly). Add a reference to System.Web.Mvc (v2.0.0.0)."

Cheers, Damrod

Upvotes: 1

Ralph Lavelle
Ralph Lavelle

Reputation: 5769

I got this error, and in my case it was resolved quite easily.

I had made a new Master Page in my Views folder, but unnoticed by me, it came with code behind and designer, which of course you don't want with MVC2. It all built, but gave me that "Parser Error Message: The type 'System.Web.Mvc.ViewMasterPage' is ambiguous:..." error when I ran it.

To fix it, I removed the code-behind and designer files for my new Master page, and the error went away.

Upvotes: 6

Chris Arnold
Chris Arnold

Reputation: 5753

Does your project reference both v1 and v2 of the framework? Also, why not delete the matching dll that's been copied locally?

Upvotes: 0

Related Questions