I can not update a reference

1

I have an MVC project. In the solution are hung some auxiliary projects. Well, what happens that I added some references and when I starto the project gives me error saying that one project has a more updated reference than the other. However, I put the two versions alike and continue. How do I solve this? It is like this. A project named Infrastructure.Data, has the same version as System.Web.MVC (4.0.0.1). The Infrastructure project does not really need this reference, but if I remove it, it gives me several "sticks", so I preferred to leave, but it still gives error. Below the error:

  

Error 1 Assembly 'Operator.Infrastructure.Data, Version = 1.0.0.0,   Culture = neutral, PublicKeyToken = null 'uses' System.Web.Mvc,   Version = 4.0.0.1, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 '     which has a higher version than referenced assembly 'System.Web.Mvc,   Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 '
    c: \ MVC_Projects \ Operator.Infrastructure.Data \ bin \ Debug \ Operator.Infrastructure.Data.dll         Operator.MVC

What I find strange is that in trying to fix the problem, this one appeared to me and everything was working, and I do not know what's happening:

  

Error 1 The type 'System.Data.Entity.DbContext' is defined in an   assembly that is not referenced. You must add a reference to   assembly 'EntityFramework, Version = 6.0.0.0, Culture = neutral,   PublicKeyToken = b77a5c561934e089 '.     C: \ Projects_MVC \ Operator.MVC \ BrandContextFacade.cs 17 18
    Operator.MVC

    
asked by anonymous 09.10.2015 / 16:11

2 answers

1

In the error itself you are saying that versão 4.0.0.1 of Operador.Infrastructure.Data is greater than System.Web.Mvc 4.0.0.0. You can only have one of these references in your project.

Projects that complement the core solution do not necessarily have System.Web.Mvc , and are only relevant to the Mvc Web project. Remove this reference and try to fix the errors they are giving, and it is not good practice to use something you do not need!

    
09.10.2015 / 16:20
1

And the same as another question here from SO, so be that answer about having problems updating NuGet Packages .

This occurs when the version of a dependency in which the NuGet package was compiled differs from the version in the project you are trying to install.

The biggest problem is that the owner of the Nuget package should not have specified which version of System.Web.Mvc the NuGet package depends on. And we ended up receiving this super inconvenient error.

What you can do to try to update all DLLs from System.Web.Mvc to 4.0.0.1 version and see if it works. Try installing this version of Microsoft AspNet MVC or earlier. I do not know exactly which one will provide the DLLs in version 4.0.0.1 (It is important not to confuse the version of the NuGet package with the version of the DLL.) A NuGet package can count several DLLs with several versions.     

23.12.2016 / 12:14