Ich versuche, meine ASP.NET 5 RC1-Projekte auf ASP.NET Core RC2-Projekte zu aktualisieren. Ich habe einige Probleme, weil ich Bibliotheken verwende, die .NET Core noch nicht unterstützen, daher muss ich auf dem gesamten Framework laufen. Das hat in RC1 gut funktioniert, aber ich bin nicht in der Lage, den richtigen Weg zu finden, dies in RC2 zu erreichen.Verwenden von net451-Bibliotheken in einer ASP.NET Core-Anwendung (RC2)
Ich habe eine Klassenbibliothek, die Pakete wiederherstellen und ordnungsgemäß erstellen kann. Und ich habe ein Testprojekt, das auf die Klassenbibliothek verweist. Wenn ich versuche, das Testprojekt zu bauen, ich bin die folgenden Fehler bekommen:
> dotnet build
Project TenantService (.NETFramework,Version=v4.5.1) was previously compiled. Skipping compilation.
Project TenantServiceTests (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling TenantServiceTests for .NETCoreApp,Version=v1.0
C:\projects\TenantService\test\TenantServiceTests\project.json(25,23): error NU1001: The dependency mscorlib could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency mscorlib could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(25,23): error NU1001: The dependency mscorlib could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency mscorlib could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(26,21): error NU1001: The dependency System could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency System could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(26,21): error NU1001: The dependency System could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency System could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(27,26): error NU1001: The dependency System.Core could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency System.Core could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(27,26): error NU1001: The dependency System.Core could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency System.Core could not be resolved.
C:\projects\TenantService\test\TenantServiceTests\project.json(9,31): error NU1001: The dependency Microsoft.CSharp could not be resolved.
Die project.json Dateien für diese beiden Projekte aussehen:
src \ TenantService \ project.json
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"Microsoft.Extensions.Options": "1.0.0-rc2-final",
"Newtonsoft.Json": "8.0.4-beta1",
"MongoDB.Driver": "2.2.4",
"StackExchange.Redis": "1.1.603"
},
"frameworks": {
"net451": {}
}
}
test \ TenantServiceTests \ project.json
{
"version": "1.0.0-*",
"testrunner": "xunit",
"description": "TenantServiceTests Class Library",
"authors": [ "Henning" ],
"dependencies": {
"xunit": "2.1.0",
"TenantService": "1.0.0-*",
"dotnet-test-xunit": "1.0.0-rc2-build10015"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
}
},
"imports": [
"net451"
]
}
}
}
Wie soll ich das richtig einrichten, um net451-Bibliotheken in meiner App zu verwenden?
Beantwortet dies wirklich die Frage, wie net451-Bibliotheken in einer ASP.NET Core-Anwendung (RC2) zu verwenden sind? Wenn ich nicht grundsätzlich etwas falsch verstehe, sieht es so aus, als ob diese Antwort nur darauf hindeutet, dass Sie stattdessen net451-Bibliotheken in net451-Anwendungen verwenden. –