JC Grubbs
JC Grubbs

Reputation: 40311

Error when I try to use the MVC Futures library with the ASP.NET MVC source code in the same solution

I get the following error when attempting to use both the MVC Futures library (Microsoft.Web.Mvc) and the ASP.NET MVC source code in the same solution:

The type 'System.Web.Mvc.Controller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I have removed the GAC reference to System.Web.Mvc in the Web.config file so that the project will use the project reference to the MVC source code. Any idea how to get around this?

Upvotes: 0

Views: 1286

Answers (2)

Craig Stuntz
Craig Stuntz

Reputation: 126557

I think that the problem is that your application and the version of the Futures library you are using reference different versions of the System.Web.Mvc assembly. You need to examine every assembly involve carefully, and make sure the dependencies align. This may require getting a new version of Futures or removing System.Web.Mvc from the GAC, depending upon the precise nature of the problem you uncover.

I'm going to dispute this bit of the question:

I have removed the GAC reference to System.Web.Mvc in the Web.config file so that the project will use the project reference to the MVC source code.

Removing this doesn't always seem to stop the ASP.NET compiler (different from the VS compiler) from finding the MVC assembly in the GAC. We ran into just this problem when trying to make projects built with RC 1 and Preview 5 coexist.

Upvotes: 1

JMS
JMS

Reputation: 2193

So does this work if you remove the reference to the MVC Futures assembly? As far as I know, the Microsoft.Web.Mvc namespace doesn't override the System.Web.Mvc.Controller class, and hence shouldn't conflict with the actual MVC assembly..

Upvotes: 0

Related Questions