Вопрос

We have cross platform project (WPF and ios) which use Mvvmcross.

We want to use Credentials in a HttpWebRequest but we use PCL library. So we created mvvmcross plugin to use System.Net.CredentialCache.DefaultNetworkCredentials.

Our plugin interface return System.Net.ICredentials which exist in WPF and Xamarin.

In WPF application it works great but ios plugin does not compile.

Le type 'System.Net.ICredentials' est défini dans un assembly qui n'est pas référencé. Vous devez ajouter une référence à l'assembly 'System.Net, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.

We try to use System.Net.Touch from mvvmcross but we have the same error.

We had extract public key of Profile104's System.Net.dll and give 2.0.5.0 version to custom dll. We add this lines in csproj :

<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Signing\system_net.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>

But it doesn't work.

Have got an idea ?

Thanks,

Это было полезно?

Решение

There are several possible solutions to this.

The 2 easiest solutions I can think of are:

  1. To build a version of your plugin dll under OSX and to use that version when you deploy to iOS.

  2. To switch to the new Xamarin alpha releases and to try to get the code working there. These new releases have official PCL support and include officially supported - including official shim assemblies from both Xamarin and Microsoft.

Personally, I'd focus on the second option - as we will all need to do this soon anyway!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top