locked
System.Runtime, inter alia, conflicts with itself RRS feed

  • Question

  • I'd like to get rid of build warnings (VS2015 on Windows 10, upgrading projects to .Net Framework 4.8) that result from conflicts like this (after first trying upgrading it to 4.1.2):

    1>  There was a conflict between "System.Runtime, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    1>      "System.Runtime, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    1>      References which depend on "System.Runtime, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\...\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll].
    1>          C:\...\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll
    1>            Project file item includes which caused reference "C:\...\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll".
    1>              System.Runtime
    1>      References which depend on "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\System.Runtime.dll].
    ...


    Friday, September 13, 2019 3:48 PM

All replies

  • The warnings either go away or become non-circular after the following:

    1) Undo all changes, and exit VS2015.

    2) Delete all bin/ , obj/ , and FakesAssemblies/ directories in the solution.

    3) Delete most directories from the solution's packages/ directory, including all problematic ones.

    4) Start VS2015.

    5) Add references to Microsoft.Bcl* for which complaints had occurred during previous attempts at building.  Avoid upgrading past Microsoft.Bcl version 1.1.8, because it wants System.Runtime version 4.1.2, which, like related packages, also has a circular dependency.

    6) Upgrade all projects to .Net Framework 4.8 .  This includes running Package-Manager commands such as "Update-Package -safe -source http://api.nuget.org/v3/index.json -reinstall System.Threading" (the running of which apparently has no bearing on the warnings).

    7) Build solution.

    (I had to exit VS2015 to avoid seeing errors that persist after they've been fixed, and rebuild to verify a clean build.)

    My guess is that the warnings have been being papered over by automatic bindingRedirect entries, which typically resolve A-to-B ranges into a B choice.  I try to avoid bindingRedirect entries, because in the past, at least, they've caused maintenance problems.



    • Edited by T. David Hudson Thursday, September 19, 2019 1:27 PM add detail
    Friday, September 13, 2019 4:37 PM
  • Hi T. David Hudson, 

    Have you solved your problem? If so, please click "Mark as answer" to the appropriate answer to close the thread, it will help other members to find the solution quickly if they have a similar issue.

    Thank you for your understanding and cooperation.                            

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 16, 2019 7:46 AM
  • Hi T. David Hudson, 

    Thanks for your feedback.

    I make a test and I try to install different versions of System.Runtime nugget packages in my application, but I find that the new version of the package will replace and uninstall the old in my application.

    Could you provide more information about your question? It will help us to reproduce your problem.

    We are waiting for your update.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 19, 2019 9:58 AM