Search code examples
c#asp.netdllvisual-studio-2017glimpse

Conflicts preventing publish, but build is fine. MVC5 ASP.NET


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!


Solution

  • 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!