Reputation: 2385
Not sure how even that could be possible, but I have got this error message:
That happened after I've:
Warning 3 The primary reference "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
I bet the solution is banal, but it must be that its Friday afternoon.
By the way, I have also VS 2008, MVC 1, MVC 2, all .NET framework versions installed and functional.
Update 1: In fact, I have exactly the same problem with MVC 2 projects targeting .NET 4.
Update 2: I feel that this is somehow related - I do really miss System.Data.Linq.dll in the folder C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
(though System.Data.Linq.xml is present)
I reinstalled .NET 4 framework but that didn't fix the problem.
Upvotes: 9
Views: 4205
Reputation: 405
this question is a little old... but if anyone else have the same message when adding a reference to a project this can be a good solution:
I downloaded PowerCommands for vs2010 http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99
it allows to copy a reference from one project to another, I do this and this works... IO suppose that editing the project file manually can work too (not tested)
Upvotes: 1
Reputation: 6092
Just had a similar problem (unable to add a reference) with a different dll. Clearing the list of recently added references did help.
Upvotes: 2
Reputation: 10940
Manually uninstall MVC3, Download Microsoft Web Platform Installer and reinstall MVC3 through WPI - that usually does a pretty good job of ensuring prerequisites are present.
Upvotes: 1