Myriad of Conflicts: Everything SignalR Core wants is >= 4.3.0 Everything Universal App wants is = 4.0.10
How do I add Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final to a windows universal project ? There are a Myriad of Conflicts: Everything SignalR Core wants is >= 4.3.0 Everything Universal App wants is = 4.0.10
I set my Target Version Min and Max both to Windows 10 Fall Creators Update as advised here: https://developercommunity.visualstudio.com/content/problem/93522/uwp-uap10015063-not-compatible-with-net-standard-2.html
But everytime i add Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final from Nuget it always rejects and rolls back my change because of the following errors im getting about 20 errors ( 1 at a time ) that all follow the same pattern:
Version conflict detected for System.Collections. Reference the package directly from the project to resolve this issue.
Assembly-CSharp -> Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final -> Microsoft.AspNetCore.SignalR.Client.Core 1.0.0-alpha2-final -> Microsoft.AspNetCore.Sockets.Abstractions 1.0.0-alpha2-final -> System.Threading.Tasks.Channels 0.1.0-alpha-001 -> NETStandard.Library 1.6.1 -> 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).
Its complaining that Signalr Requires a greater version than windows universal requires. since windows universal always use the "=" sign and signalr always use the ">=" sign this goes on for about 20 components. ( listed below )
In order for me to experiment and get past the error, i choose to manually add each time and choose the one that satisfied windows universal.
this produces a project.json that looks like this:
{ "dependencies": { "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0", "System.Collections": "4.0.10", "System.Diagnostics.Contracts": "4.0.0", "System.Diagnostics.Debug": "4.0.10", "System.Diagnostics.Tools": "4.0.0", "System.Diagnostics.Tracing": "4.0.20", "System.Globalization": "4.0.10", "System.Globalization.Calendars": "4.0.0", "System.IO": "4.0.10", "System.ObjectModel": "4.0.10", "System.Private.Uri": "4.0.0", "System.Reflection": "4.0.10", "System.Reflection.Extensions": "4.0.0", "System.Reflection.Primitives": "4.0.0", "System.Resources.ResourceManager": "4.0.0", "System.Runtime": "4.0.20", "System.Runtime.Extensions": "4.0.10", "System.Runtime.Handles": "4.0.0", "System.Runtime.InteropServices": "4.0.20", "System.Text.Encoding": "4.0.10", "System.Text.Encoding.Extensions": "4.0.10", "System.Threading": "4.0.10", "System.Threading.Tasks": "4.0.10", "System.Threading.Timer": "4.0.0" }, "frameworks": { "uap10.0.16299": {} }, "runtimes": { "win10-arm": {}, "win10-arm-aot": {}, "win10-x86": {}, "win10-x86-aot": {}, "win10-x64": {}, "win10-x64-aot": {} } }
finally when all those errors are solved i get the following large error: Detected package downgrade: System.Collections from 4.3.0 to 4.0.10. Reference the package directly from the project to select a different version. Assembly-CSharp -> Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final -> Microsoft.AspNetCore.Sockets.Client.Http 1.0.0-alpha2-final -> Newtonsoft.Json 10.0.1 -> System.Collections (>= 4.3.0) Assembly-CSharp -> System.Collections (>= 4.0.10) Detected package downgrade: System.Diagnostics.Debug from 4.3.0 to 4.0.10. Reference the package directly from the project to select a different version. Assembly-CSharp -> Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final -> Microsoft.AspNetCore.Sockets.Client.Http 1.0.0-alpha2-final -> Newtonsoft.Json 10.0.1 -> System.Diagnostics.Debug (>= 4.3.0)
goes on for about 20 errors.
How do I add Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final to a windows universal project so i can run it on the hololens?
so now im trying new things. I upgraded my project to universal 6.0 ( apparrently universal 5.0 was the project i was working with. ) but now its breaking with the following error...
------ Rebuild All started: Project: Assembly-CSharp, Configuration: Debug ARM ------ 1> Running SerializationWeaver... 1> System.Exception: Package directory not found: "C:\Users\fogbr.nuget\packages\Microsoft.NETCore.Platforms\2.0.0".
when i check my C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms directory i see C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms\2.1.0-preview1-26007-02 C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms\2.0.0-preview2-25405-01 C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms\1.1.0 C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms\1.0.1 C:\Users\fogbr.nuget\packages\microsoft.netcore.platforms\1.0.0
but no C:\Users\fogbr.nuget\packages\Microsoft.NETCore.Platforms\2.0.0
so i added the nuget package Microsoft.NETCore.Platforms 2.0.0 to both my windows universal projects but its still looking for that directory thats still missing.
Run nuget restore from Command Prompt.
1>------ Rebuild All started: Project: Assembly-CSharp, Configuration: Debug ARM ------ 1> Running SerializationWeaver... 1> System.Exception: Package directory not found: "C:\Users\fogbr.nuget\packages\Microsoft.NETCore.Platforms\2.0.0". 1> at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve() 1> at Unity.NuGetAssemblyResolver..ctor(String projectLockFile) 1> at usw.Weaver.ReaderParameters(String assemblyPath, ConversionOptions options) 1> at usw.Weaver.Weave() 1> at usw.Program.RunProgram(ConversionOptions options) 1> at usw.Program.Main(String[] args) 1>C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\Assembly-CSharp.csproj(350,5): error MSB3073: The command ""C:\org\projects\MRTraining\src\srunity2\App\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\ARM\Debug\Unprocessed\Assembly-CSharp.dll" "-pdb" "-verbose" "-unity-engine=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed\UnityEngine.CoreModule.dll" "C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\obj\ARM\Debug\ARM\Debug" "-lock=C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\project.lock.json" "@C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\SerializationWeaverArgs.txt" "-additionalAssemblyPath=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed" "-unity-networking=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed\UnityEngine.Networking.dll"" exited with code 1. 2>------ Rebuild All started: Project: srunity2, Configuration: Debug ARM ------ 2>CSC : error CS0006: Metadata file 'C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\ARM\Debug\Assembly-CSharp.dll' could not be found ========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========
1>C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\Assembly-CSharp.csproj(350,5): error MSB3073: The command ""C:\org\projects\MRTraining\src\srunity2\App\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\bin\ARM\Debug\Unprocessed\Assembly-CSharp.dll" "-pdb" "-verbose" "-unity-engine=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed\UnityEngine.CoreModule.dll" "C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\obj\ARM\Debug\ARM\Debug" "-lock=C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\project.lock.json" "@C:\org\projects\MRTraining\src\srunity2\App\GeneratedProjects\UWP\Assembly-CSharp\SerializationWeaverArgs.txt" "-additionalAssemblyPath=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed" "-unity-networking=C:\org\projects\MRTraining\src\srunity2\App\srunity2\Unprocessed\UnityEngine.Networking.dll"" exited with code 1.
There's a lot going on here, and it seems to be coupled to using Unity (which isn't a scenario we've done any work on supporting). Can you verify the minimal repro for this? Does it repro when adding the SignalR client to a clean Unity Project in Visual Studio?
-
Using a basic unity project with a cube in the middle and no scripts, i build it and generates a couple of windows universal projects.
-
one of them is a class library referenced by the other. i then go to nuget and add the signalr core client package to the universal class library
-
It rolls itself back because of version conflicts. ( fyi signalr core 2.0 is targetted to .net standard 2.0 )
-
i try to change the min and max version on the universal projects to windows fall creators update in the project settings. then add the signalr core packages. that fails.
-
i try to satisfy the version conflicts between what universal is asking for and what signalr by manually adding what universal is asking for. after going through each conflict one at a time the final conflict is signalr now is not happy.
-
I tried upgrading the universal projects from universal 5 to universal 6 then that fails because it cant find "C:\Users\fogbr.nuget\packages\Microsoft.NETCore.Platforms\2.0.0".
-
tried to manually download the nuget for Microsoft.NETCore.Platforms 2.0.0 and add a .zip extension to unzip it and manually add it to the C:\Users\fogbr.nuget\packages folder. then comes another error.
-
so desperate now that i going down the line of every point version of universal nuget packages starting with the latest one to see if it wil magically match with signalr core nuget ( e.g. not version conflict on the dependencies )
Can you confirm what version of Unity you're using? As I mentioned in #1228, it appears Unity doesn't yet support .NET Standard 2.0 libraries, but will in the upcoming 2018.1 release.
Unity 2017.2.0p2-MRTP5 the one told to use at https://holodevelopers.slack.com/ to build applications for the hololens. im trying now with the new version of unity still installing ( new unity Unity2017.2.0f3 ) came out today
ultimately this is a hololens application
I initially failed many times trying to build a .net 4.6.1 classlibrary and adding signalr core there first and then importing that into unity in the plugins directory. that never made it to generating the universal projects but it did work inside the unity editor itself as you can see here https://drive.google.com/open?id=1CZ7R29fylD5cKphn9jMQAKFFOGoRdwpj
Adding SignalR to a .net 4.6.1 class library first isn't any different. The SignalR client libraries are not supported by Unity 2017.2 at all as they require a platform that supports .NET Standard 2.0 and Unity 2017.2 does not support that platform. Referencing them "via" a .NET 4.6.1 doesn't solve the problem as Unity still has to be able to load the SignalR client libraries themselves and it can't. Once 2018.1 is out, SignalR should be supported there, and if you run in to problems with that, we can investigate further. Until then, there isn't really anything we can do to help here, the problem is in Unity.
I'm closing this issue, but feel free to continue discussion. There's nothing we can do right now to fix this issue until Unity is updated.
yeah but can you give me any insight into why this clashed with a generated visual studio project. Ultimately the ball is back in microsoft court if they use your technology to create a msbuild file and add dependencies to it.
ultimately this is a visual studio solution with 2 universal projects that i cant add signalr to no?
There may be an issue with how this is handled by the Universal project system, but that's beyond our ability to help you with :). That would be feedback best given via https://developercommunity.visualstudio.com/ so that the team responsible for that can see it.
yeah but signalr is asking for System.Collections (>= 4.3.0) and windows universal wants System.Collections (==4.0.10)
they are going to tell me to come back here no?
I see, I missed that in the issue above. That is being brought in by the pre-release corefx components we're using. It's possible they don't support UWP currently (as we don't currently verify the client on UWP; it's planned for release, but we haven't gotten there yet). I'll do a little more investigation and see what I can find.
ill keep trying trial and error here because i have a hard requirement to run signalr on linux in order to move it from on premises to the cloud in docker containers.
Hmm, you seem to still have a reference to the UWP 5.0 runtime in your package graph. UWP 5.0 does not support .NET Standard 2.0 (and thus SignalR Core). I believe you need to use UWP 6.0. I would have expected VS to update you when you changed your Target Version but I don't know if there's an issue in that project system.
I created a new UWP project targetting Windows 10 Fall Creators Update and in the NuGet package dialog it shows that I have UWP 6.0 installed. When I install Microsoft.AspNetCore.SignalR.Client into that project, it succeeds without any issue.
Have you checked if you can update the Microsoft.NETCore.UniversalWindowsPlatform package? SignalR appears to be compatible with version 6.0.5 (the latest)
bathroom break.. when i come back .. ill start from a clean unity 2017.3.0f3 build it and then set the csprojects to use version 6.0.5 of universal .. i think i tried that and that didnt work either.
You'll likely get the issue you posted later in this thread about SerializationWeaver failing. That's a Unity component so I would expect it to fail until you are able to run Unity 2018.1.
first try adding Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final to generated unity Unity2017.2.0f3 windows universal project. (generated projects still use universal 5.0)
Restoring packages for C:\org\projects\MRTraining\src\srnewunity\App\GeneratedProjects\UWP\Assembly-CSharp\project.json... Package Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240). Package Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final supports: netstandard2.0 (.NETStandard,Version=v2.0) ... more of the same errors Package restore failed. Rolling back package changes for 'Assembly-CSharp'.
I will upgrade both projects to universal 6.0.5 (the latest) and try again
ok so upgrading to universal 6.0.5 i could build without Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final but then when i add signalr i get a rollback again... Package Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final is not compatible with uap10.0.10240 (UAP,Version=v10.0.10240). Package Microsoft.AspNetCore.SignalR.Client 1.0.0-alpha2-final supports: netstandard2.0 (.NETStandard,Version=v2.0)
no sign of serialization weaver <--
ill change the min and max version on the universal project and try again.