2017-05-10 1 views
1

Ich versuche, einen Verweis auf das Paket PCLCrypto (2.0.147) in einem Projekt NetStandard 1.3 unter Verwendung vonReferenzierung PCLCrypto in einem NetStandard1.3 Projekt

hinzufügen Nachdem ich den Import „portable-net45 + netcore45 hinzufügen + wpa81 "in der project.json baut es auf, zeigt aber weiterhin die fehler an.


project.json:

{ 
    "supports": {}, 
    "dependencies": { 
    "Microsoft.EntityFrameworkCore": "1.1.1", 
    "NETStandard.Library": "1.6.1", 
    "PCLCrypto": "2.0.147", 
    "System.ComponentModel.Primitives": "4.1.0", 
    "WraUtil.Helpers": "1.8.2" 
    }, 
    "frameworks": { 
    "netstandard1.3": { 
     "imports": "portable-net45+netcore45+wpa81" 
    } 
    } 
} 

Fehler:

Severity Code Description Project File Line Suppression State 
Error  Package PInvoke.NCrypt 0.3.2 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package PInvoke.NCrypt 0.3.2 supports: 
    - net40 (.NETFramework,Version=v4.0) 
    - portable-net40+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile92) 
    - portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111) 
Error  Package Validation 2.2.8 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package Validation 2.2.8 supports: 
    - dotnet (.NETPlatform,Version=v5.0) 
    - portable-dnxcore50+monoandroid10+monotouch10+net45+win+wp8+wpa81+xamarinios10 (.NETPortable,Version=v0.0,Profile=net45+dnxcore50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10) 
    - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328) 
Error  Package PCLCrypto 2.0.147 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package PCLCrypto 2.0.147 supports: 
    - monoandroid23 (MonoAndroid,Version=v2.3) 
    - monotouch10 (MonoTouch,Version=v1.0) 
    - net45 (.NETFramework,Version=v4.5) 
    - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) 
    - portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32) 
    - wp8 (WindowsPhone,Version=v8.0) 
    - xamarinios10 (Xamarin.iOS,Version=v1.0) 
Error  One or more packages are incompatible with .NETStandard,Version=v1.3. 
Error  Package PCLCrypto 2.0.147 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package PCLCrypto 2.0.147 supports: 
    - monoandroid23 (MonoAndroid,Version=v2.3) 
    - monotouch10 (MonoTouch,Version=v1.0) 
    - net45 (.NETFramework,Version=v4.5) 
    - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) 
    - portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32) 
    - wp8 (WindowsPhone,Version=v8.0) 
    - xamarinios10 (Xamarin.iOS,Version=v1.0) 
Error  One or more packages are incompatible with .NETStandard,Version=v1.3. 
Error  Package Validation 2.2.8 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package Validation 2.2.8 supports: 
    - dotnet (.NETPlatform,Version=v5.0) 
    - portable-dnxcore50+monoandroid10+monotouch10+net45+win+wp8+wpa81+xamarinios10 (.NETPortable,Version=v0.0,Profile=net45+dnxcore50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10) 
    - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328) 
Error  Package PInvoke.NCrypt 0.3.2 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package PInvoke.NCrypt 0.3.2 supports: 
    - net40 (.NETFramework,Version=v4.0) 
    - portable-net40+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile92) 
    - portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111) 

Muss ich noch etwas konfigurieren müssen?

Antwort

2

Im Feld imports in Ihrer Datei project.json sollten Sie ein Zielframework einfügen, das mit PCLCrypto 2.0.147 kompatibel ist, und diese Fehler geben Ihnen im Grunde an, welche Optionen Sie haben.

Zum Beispiel einer dieser unterstützten Zielrahmen ist portable-net45+win8+wp8+wpa81 die mit netstandard1.0 kompatibel ist, was bedeutet, dass sie auch von einem netstandard1.3 Projekt referenziert werden (Sie here weitere Informationen über die Kompatibilität zwischen den alten PCL Profile und neue finden. NET Standardversionen).

Aktualisieren Sie also Ihr imports Feld auf: "imports": "portable-net45+win8+wp8+wpa81".

Kleine Bonus - für den Fall, entscheiden Sie von project.json neuen MSBuild (csproj) Stil Projekte zu bewegen, können Sie das gleiche mit erreichen:

<PropertyGroup> 
    <TargetFramework>netstandard1.3</TargetFramework> 
    <PackageTargetFallback>portable-net45+win8+wp8+wpa81</PackageTargetFallback> 
</PropertyGroup> 
+0

Dank für die Klärung. Ich habe den Import in jedes netstandard1.3-Projekt meiner Lösung eingefügt. Es kompiliert normal und die Nachrichten waren weg. –

Verwandte Themen