I can’t update a reference

Asked

Viewed 874 times

1

I have an MVC project. At Solution are hanging some auxiliary projects. Well, it turns out that I’ve added a few references and when I start the project it gives me the error of saying that one project has a more up-to-date reference than the other. However, I put the two versions the same and continue. How do I solve this? It’s like this. A project called Infrastructure.Data, has the same version as System.Web.MVC(4.0.0.1). The Infrastructure project doesn’t really need this reference, but if I remove it, it gives me several "sticks", so I preferred to leave, but it keeps giving error. Down with 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: Projects_mvc Operator.Infrastructure.Data bin Debug Operator.Infrastructure.Data.dll Operator.

What I find strange is that in trying to fix the problem, this came to me and it was all working, and I don’t know what’s going on:

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.

2 answers

1

And the same case of another question here from the O.R., so be that answer about having problems updating Nuget Packages.

This occurs when the version of a dependency on which the Nuget package was compiled is different from the version of in the project in which one is trying to install.

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

What can you do to try to actualziar all DLL’s System.Web.Mvc for the version 4.0.0.1 and see if it works. Try to install this version of Microsoft Aspnet MVC or earlier. I don’t know exactly which Dlls will provide in version 4.0.0.1 (Important not to confuse the version of the Nuget package with the DLL version. A Nuget package can count on multiple Dlls with multiple versions).

1

In the error itself is saying that the 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.

Really projects that complement the main solution do not need to have the System.Web.Mvc, relevant only in the project Mvc Web. Remove this reference and try to fix the errors that are giving, plus it is not good practice to use something that you do not need !!!

  • So it turns out that I added the same reference to both projects and I don’t know why is giving this version inconsistency.

  • In reality everything was stuck in the Entity’s Assembly. I removed everything and reinstalled it and it solved. He would give a message, but the core of the problem was in Entity. By Nuget I updated everything and now it’s fine.

  • It’s no problem see well, is that shocked versioning among the various other installed packages, but also reinforcing you do not need to have the System.Web.Mvc in all projects ... Well I’m just warning you ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.