views:

1272

answers:

3

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.

A: 

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

Chris Arnold
The dll gets created in the bin directory automatically when you build the project. I'm only referencing v2 and only have v2 on the machine.
Sohnee
@Sohnee: You can set referenced assemblies to not be copied to the bin folder (right click on the reference and select properties).
Richard
I thought the idea was that you wanted the local dll in the bin folder for deployment onto "MVC not installed" hosting? Am I missing something.
Sohnee
A: 

Okay. I have performed another uninstall, got the latest RC from MS and re-installed and the problem has gone away.

This was the source for the download, which is strangely tricky to find if you search on MSDN:

http://www.microsoft.com/downloads/details.aspx?familyid=3B537C55-0948-4E6A-BF8C-AA1A78878DA0&displaylang=en

Sohnee
A: 

Hello Schnee,

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

Damrod
Hi Damrod, thanks for the hint - I've never had another implementation of MVC on this machine, so it's not the problem in this case. Cheers.
Sohnee
This problem still persists in ASP .NET MVC 2 RTM for Visual Studio 2008. The same mistake is also made in the autogenerated Unit Test project.
Bloodsplatter