none
Unable to install Azure packages in Visual Studio RRS feed

  • Question

  • I made a simple application in Unity and converted it into a UWP application. The application is working fine.

    Now I want to connect the UWP to Micrsosoft Azure's IoT Hub. I tried to install Microsoft.Azure.Devices.Client package from NuGet Package manager. But I get the following output:

    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-arm 1.0.0 requires System.Diagnostics.Contracts (= 4.0.0) but version System.Diagnostics.Contracts 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-arm 1.0.0 requires System.Diagnostics.StackTrace (= 4.0.0) but version System.Diagnostics.StackTrace 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.Native 1.0.0 requires System.Diagnostics.Contracts (= 4.0.0) but version System.Diagnostics.Contracts 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.Native 1.0.0 requires System.Diagnostics.StackTrace (= 4.0.0) but version System.Diagnostics.StackTrace 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-x64 1.0.0 requires System.Diagnostics.Contracts (= 4.0.0) but version System.Diagnostics.Contracts 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-x64 1.0.0 requires System.Diagnostics.StackTrace (= 4.0.0) but version System.Diagnostics.StackTrace 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-x86 1.0.0 requires System.Diagnostics.Contracts (= 4.0.0) but version System.Diagnostics.Contracts 4.3.0 was resolved.
    Detected package version outside of dependency constraint: Microsoft.NETCore.Runtime.CoreCLR-x86 1.0.0 requires System.Diagnostics.StackTrace (= 4.0.0) but version System.Diagnostics.StackTrace 4.3.0 was resolved.
    Version conflict detected for System.Collections. Reference the package directly from the project to resolve this issue. 
     Assembly-CSharp -> Microsoft.Azure.Devices.Client 1.6.1 -> DotNetty.Handlers 0.4.7 -> DotNetty.Transport 0.4.7 -> System.Net.Primitives 4.3.0 -> runtime.win.System.Net.Primitives 4.3.0 -> System.Collections (>= 4.3.0) 
     Assembly-CSharp -> Microsoft.NETCore.UniversalWindowsPlatform 5.0.0 -> Microsoft.NETCore.Runtime 1.0.0 -> Microsoft.NETCore.Runtime.CoreCLR-arm 1.0.0 -> System.Collections (= 4.0.10).
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-arm.
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-arm-aot.
    System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-arm-aot.
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x64.
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x64-aot.
    System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x64-aot.
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x86.
    System.Net.Security 4.3.0 provides a compile-time reference assembly for System.Net.Security on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x86-aot.
    System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0.10240, but there is no run-time assembly compatible with win10-x86-aot.
    Package restore failed. Rolling back package changes for 'Assembly-CSharp'.

    I also tried adding the same package in an ordinary UWP app and its working fine. Kindly give some suggestions to handle this error.

    • Moved by Fei Hu Tuesday, January 23, 2018 10:37 AM From C#
    Saturday, January 20, 2018 8:12 PM

All replies

  • Search for "Detected package version outside of dependency constraint" on the following page for the reasoning behind this message. In short the package is higher than the dependency constraint which is indicated right in the error messages in your initial post.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, January 20, 2018 8:52 PM
  • Hi,

    >>I also tried adding the same package in an ordinary UWP app and its working fine.

    This might be relate to Unity support, so I suggest you ask for Unity Community for help.

    If there is a problem with the NuGet package installed on a regular UWP project. You should ask this question in Visual Studio forum, and this forum is discuss question about C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Bob


    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, January 22, 2018 9:34 AM