1

Closed

Can't install SSH.NET into Xamarin Android Project

description

When using NuGet Package Manager (latest version) to install SSH.NET into a Xamarin Android project in Visual Studio 2015 Community Edition, I get the following error - is there anything I can do about this or is it just not going to fly?

Thanks in anticipation - Tim

Attempting to gather dependency information for package 'SSH.NET.2013.4.7' with respect to project 'TaskyAndroid', targeting 'MonoAndroid,Version=v6.0'
Attempting to resolve dependencies for package 'SSH.NET.2013.4.7' with DependencyBehavior 'Lowest'
Resolving actions to install package 'SSH.NET.2013.4.7'
Resolved actions to install package 'SSH.NET.2013.4.7'
Install failed. Rolling back...
Package 'SSH.NET.2013.4.7' does not exist in project 'TaskyAndroid'
Package 'SSH.NET.2013.4.7' does not exist in folder 'C:\Users\Tim\Downloads\Tasky\packages'
Could not install package 'SSH.NET 2013.4.7'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', 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.
========== Finished ==========
Closed Sep 17, 2016 at 7:31 AM by drieseng
Fixed in newer versions of Xamarin Studio.

comments

drieseng wrote Jul 23, 2016 at 6:49 PM

This should work fine with the upcoming 2016.0.0 release.
Support for .NET Core (.NETStandard 1.3) will be available in beta 3, and this should work fine in Xamarin.
If you want to follow up on this, please open an issue in our new home at GitHub:
https://github.com/sshnet/SSH.NET

TimHaydnJones wrote Jul 25, 2016 at 3:16 PM

Hi drieseng - thanks for taking the time to reply.
Any idea when the beta 3 release might be out?
Thanks

Tim

drieseng wrote Jul 27, 2016 at 12:34 PM

2016.0.0-beta3 is available now.
Get it here!

wrote Jul 27, 2016 at 12:34 PM

TimHaydnJones wrote Jul 27, 2016 at 3:05 PM

Thanks drieseng. I can confirm that SSH.NET beta 3 was successfully installed into my Xamarin project but it seems to have brought a new issue with it and provokes the following error on building the project

Severity Code Description Project File Line
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Security.Cryptography.Primitives.dll'
at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute() TaskyAndroid

Any suggestions pls?

Thanks

Tim

TimHaydnJones wrote Jul 27, 2016 at 3:20 PM

Sorry, meant to add, this seems to have been introduced with the SshNet.Security.Cryptography v1.2.0 which is installed as part of SSH.NET beta 3. Uninstalling SshNet.Security.Cryptography v1.2.0 removes the error and the project builds OK

drieseng wrote Jul 27, 2016 at 4:21 PM

Which target framework version of SSH.NET is Xamarin picking up ?

The SshNet.Security.Cryptography package has a dependency on the System.Security.Cryptography.Primitives package for the .NETStandard1.3 and UAP10.0 TFMs.
If Xamarin is using one of these target framework (I would expect it to use .NETStandard1.3), then it should also find the System.Security.Cryptography.Primitives assembly.

You should not (have to) remove the SshNet.Security.Cryptography package as SSH.NET relies on it for the RIPEMD160 HMAC and hash algorithm.

drieseng wrote Jul 27, 2016 at 4:21 PM

** Closed by drieseng 27/07/2016 5:34

wrote Jul 27, 2016 at 4:21 PM

wrote Jul 27, 2016 at 4:22 PM

TimHaydnJones wrote Jul 27, 2016 at 5:39 PM

Hi again drieseng - sorry to be a pain in the ****

Is this what you were asking? (the output from Package Manager on installing the beta 3)

Attempting to gather dependency information for package 'SSH.NET.2016.0.0-beta3' with respect to project 'TaskyAndroid', targeting 'MonoAndroid,Version=v6.0'
Attempting to resolve dependencies for package 'SSH.NET.2016.0.0-beta3' with DependencyBehavior 'Lowest'
Resolving actions to install package 'SSH.NET.2016.0.0-beta3'
Resolved actions to install package 'SSH.NET.2016.0.0-beta3'
Adding package 'SSH.NET.2016.0.0-beta3' to folder 'C:\Users\Tim\Downloads\Tasky\packages'
Added package 'SSH.NET.2016.0.0-beta3' to folder 'C:\Users\Tim\Downloads\Tasky\packages'
Added package 'SSH.NET.2016.0.0-beta3' to 'packages.config'
Successfully installed 'SSH.NET 2016.0.0-beta3' to TaskyAndroid
========== Finished ==========

Cheers

Tim

drieseng wrote Jul 28, 2016 at 11:21 AM

I've since been able to reproduce this issue myself.
Xamarin is actually using the .NETStandard1.3 target framework version of SSH.NET, but doesn't support/load the System.Security.Cryptography.Primitives assembly.

I've contacted someone at Microsoft/Xamarin for this issue.

TimHaydnJones wrote Jul 28, 2016 at 12:11 PM

Much appreciated drieseng - you OpenSource guys are just incredible.

drieseng wrote Jul 28, 2016 at 8:15 PM

I may have been told that support for .NETStandard1.3 in Xamarin is being worked on :-)
If that happens to be true, then that would resolve this issue.

wrote Sep 17, 2016 at 7:31 AM