SocketIoClientDotNet with Visual Studio for mac can't install - c#

I am using Visual Studio for mac.
I tried to download SocketIoClientDotNet on nuget.
But I failed to install the package.
[MY SPEC]
Visual Studio Community 2017 for Mac
Version 7.1 (build 1297)
Runtime:
Mono 5.2.0.215 (d15-3/da80840) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 502000215
NuGet
버전: 4.3.0.2418
.NET Core
Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
1.5.5
/Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b
Xamarin.Mac
Version: 3.6.0.19 (Visual Studio Community)
Attempting to gather dependency information for package 'SocketIoClientDotNet.0.9.13' with respect to project 'Chat', targeting '.NETPortable,Version=v4.5,Profile=Profile111'
GET https://api.nuget.org/v3/registration3-gz-semver2/socketioclientdotnet/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/socketioclientdotnet/index.json 1290ms
Total number of results gathered : 2
Gathering dependency information took 1.3 sec
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 1.3 sec
Attempting to resolve dependencies for package 'SocketIoClientDotNet.0.9.13' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'SocketIoClientDotNet.0.9.13'
Resolved actions to install package 'SocketIoClientDotNet.0.9.13'
Retrieving package 'SocketIoClientDotNet 0.9.13' from 'nuget.org'.
For adding package 'SocketIoClientDotNet.0.9.13' to project 'Chat' that targets 'portable45-net45+win8+wpa81'.
Install failed. Rolling back...
Package 'SocketIoClientDotNet.0.9.13' does not exist in project 'Chat'
Package 'SocketIoClientDotNet.0.9.13' does not exist in folder '/Users/LSH/Work/Dev/WebServer/Chat/packages'
Executing nuget actions took 139.18 ms
Could not install package 'SocketIoClientDotNet 0.9.13'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The SocketIoClientDotNet 0.9.13 NuGet package has two portable assemblies:
lib/portable-win81+wpa81
lib/portable-wpa81+wp81
These do not map to any known Portable Class Library (PCL) profile so NuGet will not allow you to install it into a portable class library project.
The latest SocketIoClientDotNet beta version 1.0.2-beta1 has no PCL assemblies. Instead it has a .NET Standard 1.3 assembly. Unfortunately you cannot use that in a PCL project either.
So either you find another NuGet package that provides what you need and also supports PCL projects or you will have to modify your project to be a .NET Standard project that targets at least .NET Standard 1.3.

Related

NuGet package install fails "Package restore failed. Rolling back package changes for <xamarin.android>"

Installing any package fails with this error, updating packages also creates this error. Clearing the NuGet cache files causes this error to change to "access to the path mono.cecil.dll is denied" when trying to install "Xamarin.GooglePlayServices.Ads". Restarting visual studio causes the package restore error to come back.
Versions:
OS: win 10
Visual Studio Information:https://pastebin.com/vnuyZMWk
Xamarin.Forms Project:
Target framework: .NET 2.0
Xamarin.Android project:
Minimum Android Version: 5.0 (API Level 21)
Target Android Version: Use Compile Using SDK version (8.0)
Well after some trial and error I have the solution.
Visual Studio:
Update visual studio https://pastebin.com/GkEeRqg3
Updates Xamarin.Forms and NuGet
Repair visual studio from the "Visual Studio installer"
This Fixes the access denied to *.dll error
Xamarin.Android project:
Set Target Android Version: 8.1 API 27
This makes the packages the require monoandroid81 happy.
Cleaning house
Delete the folder C:\Users\<Your_Name>\AppData\Local\Xamarin`
Not sure if this was necessary but I am documenting anything I did so others can replicate the solution.
Fixing NuGet
Right-click <Project_name>.android --> Set as startup project.
Tools --> NuGet Package Manager --> Package Manager Console
In the console CLI run Update-Package -Reinstall
Why did this happen?
One way or another some of the NuGet packages used in Xamarin.Android used monoandroid81. Even though my solution was set to use 80 some NuGet packages installed were only compatible with 81. This was shown in the NuGet Console.
Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports:
monoandroid81 (MonoAndroid,Version=v8.1)
I faced the same error when I was trying to update the libraries one by one. Then I tried selecting all required libraries and clicked the Update button bellow the search box and it works. I have to tell that these libraries had dependencies between each other.
Here's an example:

Cannot update nuget package (PCL)

I'm getting this error when using maps in Android:
System.MissingMethodEsception: Method
'Xamarin.Forms.maps.Android.MapRenderer.OnCameraChange' not found.
And I've read that you can update the nugetpackage to fix the issue. However, I cannot install it due to this:
Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The updates of packages installs just find in iOS and Android but not for PCL. I've tried to remove all the packages and then tried to add TK.Customs nuget package but this same issue.
Also tried to install it on a fresh project and that installed just fine. Just cant get it to install on my old project.
Here is the whole error message when trying to update package:
Attempting to gather dependency information for package 'TK.CustomMap.2.0.1' with respect to project 'Vernamo', targeting '.NETPortable,Version=v4.5,Profile=Profile78'
GET https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json 175ms
Total number of results gathered : 29
Gathering dependency information took 232 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 204.03 ms
Attempting to resolve dependencies for package 'TK.CustomMap.2.0.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'TK.CustomMap.2.0.1'
Resolved actions to install package 'TK.CustomMap.2.0.1'
Found package 'TK.CustomMap 2.0.1' in '/Users/holger/Downloads/Vernamo/packages'.
For adding package 'TK.CustomMap.2.0.1' to project 'Vernamo' that targets 'portable45-net45+win8+wp8'.
Install failed. Rolling back...
Package 'TK.CustomMap.2.0.1' does not exist in project 'Vernamo'
Executing nuget actions took 52 ms
Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The pre-release version (at least pre2) of TK.CustomMap supported all platforms (see here), anyway, as of pre3 (see here), obviously the support for all platforms was dropped in favor of .NET Standard (1.1 in this case).
The profile you are using in your PCL does not seem to be compatible with .NET Standard 1.1, hence NuGet fails to add the reference. You may try to switch to another profile (.NET 4.5.1 for example), but I don't know if that would help. Another option would be to migrate your projects to .NET Standard. It's kind of a stupid, repetetive task, but it's possible.

I Cant Install Microsoft.Identity.Client In Xamarin.Forms

I Try to Install Microsoft.Identity.Client Nuget to my Xamarin.Forms Project. But every time i try to install the package I always get this error message:
Could Not install package ' Microsoft.Identity.Client 1.0341221-alpha'. You are trying to install this Package into a project
that targets '.NetPortable,Version=v4.5,Profile=Profile259, but the package does not contain any assembly references or content files that are compatible with that framework for more iformation, conct the package author
What should I do here, I have already tried all version of the package, and try to install the package from Package Manager Console
The error is very clear, the NuGet does not contain any target platforms that are supported in your PCL profile 259.
You should migrate your PCL to a .NET Standard library, at least version 1.1 to consume the NuGet package in your shared code. Alternatively, you could abstract it away with an Interface and Dependency Injection, which probably will be more time consuming.

Cannot update Microsoft.Extensions.Logging to (2.0) Mono Develop 6.1.4

My packages in my project indicated there was a version update to 2.0 for:
Microsoft.Extensions.Logging
NETStandard.Library
Microsoft.NETCore.Platforms
The only one I cannot get to update is Microsoft.Extensions.Logging
The Error I get is this:
Package 'Microsoft.Extensions.Logging 2.0.0' does not exist in folder '/home/MyUser/UpdatedPon/pon/sbmanager/packages'
Could not install package 'Microsoft.Extensions.Logging 2.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I have been searching the internet the past few days looking for a solution, but I have not found one as of yet.
Has any one ran into this issue, I am running MonoDevelop 6.1.4
and my MONO version is 5.2.0.215.
Lastly this is a WebForms application.
The Microsoft.Extensions.Logging 2.0.0 NuGet packages has assemblies for .NET Standard 2.0.
A more recent version of NuGet is required for .NET Standard 2.0 to be recognised as a target framework. So you would need to use MonoDevelop 7.1 for this to work. Also your project would need to target .NET 4.6.1 to be able to install the NuGet package.
Alternatively you could try installing the older version Microsoft.Extensions.Logging 1.1.2 which contains .NET Standard 1.1 assemblies which should be recognised by MonoDevelop 6.1.

How do I install WindowsAzure.Storage in Visual Studio 2013?

Note: this answer didn't help me because I don't have the same dll: System.Collections.Immutable 1.1.37
I'm using Visual Studio 2013 and .net 4.5 and following this tutorial: Get started with Azure Blob storage using .NET
I am trying to install WindowsAzure.Storage but get this error:
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.8.2)'.
Attempting to resolve dependency 'System.Spatial (= 5.8.2)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.8.2)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.8)'.
Attempting to resolve dependency 'Microsoft.Data.Services.Client (≥ 5.8.2)'.
Attempting to resolve dependency 'System.Net.Requests (≥ 4.0.11)'.
Attempting to resolve dependency 'System.ComponentModel.EventBasedAsync (≥ > 4.0.11)'.
Attempting to resolve dependency 'System.Dynamic.Runtime (≥ 4.0.0)'.
Attempting to resolve dependency 'System.Linq.Queryable (≥ 4.0.0)'.
The 'System.Linq.Queryable 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.12.0.817'.
when I upgrade Nuget per the red error in the image, it takes me to Extensions and Updates asking to update this:
I don't know the relation between what I am looking for and this, but I went ahead and followed that update anyway, but get the error:
Where should I proceed from here!?
based on comment form Simsons, I already checked that my processor supports Virtualization:
When you try to install the WindowsAzure.Storage package through NuGet, this is the key error;
Attempting to resolve dependency 'System.Linq.Queryable (≥ 4.0.0)'. The 'System.Linq.Queryable 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.12.0.817'
Unfortunately, System.Linq.Queryable 4.0.0 requires NuGet 3.0 or above. So this isn't going to work on Visual Studio 2013.
Luckily, the newer System.Linq.Queryable 4.3.0 only requires NuGet 2.12 which is available for Visual Studio 2013.
So, to successfully install WindowsAzure.Storage in Visual Studio 2013 via NuGet:
Download and Install NuGet 2.12 if you don't already have it. (OP has confirmed already having this version)
In NuGet, Install System.Linq.Queryable 4.3.0
In NuGet, Install WindowsAzure.Storage
Open your Visual Studio 2013. Go to Tools > NuGet Package Manager > Package Manager Console
In the packet manager console type:
Install-Package NuGet.Client -Version 3.2.0
I tried this using NuGet Client version 3.2.0. The current latest version is 4.3 (beta) or 4.2. So I'm not sure if it will work for versions 4.2 and 4.3, but it surely works for NuGet 3.2.0. NuGet >3 was all I needed for SendGrid and other packages.
Clearly for Visual Studio 2013 you can only use NuGet 2.12,
https://www.nuget.org
If you want to use NuGet 3.x as well as those packages that require NuGet 3.x, you have to upgrade to Visual Studio 2015 and above.

Categories