-1

I am facing a problem in asp.NET MVC5. After adding a new project to my solution (database project, to connect to a remote SQL server and uses the Entity Framework 6), I am unable to Publish. Everything builds fine, and works like a charm on localhost, but the moment I try to publish I get this warning:

Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listen in the build log when log verbosity is set to detailed.

This warning is said to come from my .Data (database project), but I have all my references, packages, etc inside my .Web project.

So far I have tried Cleaning each project in my solution, rebuilding, Cleaning the complete solution, rebuilding, and nothing works.

After researching more how to fix this problem, I changed my Build log to Diagnostic, and found at least what the conflict is. The conflict inside my Diagnostic build log is the following:

There was a conflict between "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null". (TaskId:62) 2> "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" was not. (TaskId:62) 2> References which depend on "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" [C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll]. (TaskId:62) 2> C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll". (TaskId:62) 2> Glimpse.Core, Version=1.8.6.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> References which depend on "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" []. (TaskId:62) 2> C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll". (TaskId:62) 2> Glimpse.AspNet, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll". (TaskId:62) 2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)

Again to mention that the said warning in Vstudio is said to be comming from my .Data project, but Glimpse is only installed on my .Web project.

I continued my attempts at fixing this but nothing has been successful. So far I have tried to Remove Glimpse dependencies, Reinstall Glimpse (core,mvc,aspnet), Update-Package -reinstall Glimpse, as well from nugget manager. I have tried clearing Nugget cache. I have went over each .csproj file and only found the Glimpse Version=1.8.6.0 (i had previous conflicts, but the fix was easy since both versions were present in the .csproj, and now I have only 1 version of Glimpse).

I have also attempted to rebuild, reclean, reinstall and update the packages,projects,solution from both VStudio 2017 and VStudio 2013 (main Vstudio that I use is 2017).

If more information/parts of code, errors are needed let me know so I can update my question!

Please if somebody has any idea on how to fix, let me know. If you post comments/answers please be as detailed as possible! Thank you!

N. Ivanov
  • 1,795
  • 2
  • 15
  • 28
  • Does it build in `Release` mode which is what publish uses? Note also that cleaning the project doesn't remove references which aren't in the project, you could try completely deleting the bin directories. – stuartd Aug 10 '17 at 11:12
  • @stuartd it does build in Release mode, and runs fine. It's just when attempting to publish. Wouldn't deleting the bin directories break the Solution? and if I attempt deleting them, should I delete the bin directory on each project? Thanks! – N. Ivanov Aug 10 '17 at 11:16
  • The bin directories are just recreated when you build, just as they would be if you did a fresh checkout. To be extra cautious, you could take a copy of the project folder and do it on that. – stuartd Aug 10 '17 at 11:20
  • If you right-click on the solution node in the Solution Explorer and select "Manage NuGet Packages for Solution" and then click on the "Consolidate" tab does it show any conflicts? If so, consolidate them to a single version. If it doesn't show any errors check your .config files for version differences. – Jeff Aug 10 '17 at 11:26
  • @Jeff it is empty, I also checked the config files there is no version differences. I will continue investigating, Thanks! – N. Ivanov Aug 10 '17 at 11:34

2 Answers2

1

If you install nuget package Glimpse.MVC5 and Glimpse.EF6, package Glimpse.EF6 depends on Glimpse.Core 1.8.6 and package Glimpse.MVC5 depends on Glimpse.Core 1.8.2.

Step 1. Installation package Glimpse.MVC5

PM> Install-Package Glimpse.MVC5
Attempting to resolve dependency 'Glimpse.AspNet (≥ 1.8.0)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.2)'.
'Glimpse.Mvc5 1.5.3' already installed.
Adding 'Glimpse 1.8.2' to GPG.MVC5.Web.
Installing 'Glimpse 1.8.2'.
Successfully installed 'Glimpse 1.8.2'.
Successfully added 'Glimpse 1.8.2' to GPG.MVC5.Web.
Adding 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Successfully added 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Adding 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.

In package.config 

  <package id="Glimpse" version="1.8.2" targetFramework="net451" />
  <package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
  <package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />

Step 2. Installation package Glimpse.EF6

PM> Install-Package Glimpse.EF6
Attempting to resolve dependency 'Glimpse.Ado (≥ 1.7.3)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.6)'.
Installing 'Glimpse.Ado 1.7.3'.
Successfully installed 'Glimpse.Ado 1.7.3'.
Installing 'Glimpse.EF6 1.6.5'.
Successfully installed 'Glimpse.EF6 1.6.5'.
Removing 'Glimpse 1.8.2' from GPG.MVC5.Web.
Successfully removed 'Glimpse 1.8.2' from GPG.MVC5.Web.
Adding 'Glimpse 1.8.6' to GPG.MVC5.Web.
Successfully added 'Glimpse 1.8.6' to GPG.MVC5.Web.
Adding 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Adding 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Successfully added 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Uninstalling 'Glimpse 1.8.2'.
Successfully uninstalled 'Glimpse 1.8.2'.


In package.config: 

  <package id="Glimpse" version="1.8.6" targetFramework="net451" />
  <package id="Glimpse.Ado" version="1.7.3" targetFramework="net451" />
  <package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
  <package id="Glimpse.EF6" version="1.6.5" targetFramework="net451" />
  <package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />
Guillermo Santos
  • 1,361
  • 1
  • 11
  • 7
0

After numerous hours of investigating, debugging, deleting, updating, trying all kinds of solutions I finally found a solution to my problem. Somehow on my FTP Publish Settings under File Publish Options the Precompile during publishing option got unchecked, after checking it, and trying to Publish, I had no errors or warnings whatsoever, and the Solution started publishing. I hope this helps whoever is facing a similar issue! And thank you to everybody who gave suggestions in the comments!

N. Ivanov
  • 1,795
  • 2
  • 15
  • 28