2016-05-10 11 views
2

Ich baue eine API mit .net Kern, und ich habe gerade laufen in dieser Frage während der Veröffentlichung zu veröffentlichen:Unable .NET Core-app (nicht unterstützte Laufzeit)

The project being published does not support the runtime 'dnx-clr-win-x86.1.0.0-rc2-20221' 

Ich sah this github issue sowie this one und ich bin nicht näher an einer Lösung. Hier ist meine aktualisiertproject.json Datei:

{ 
    "compilationOptions": { 
    "debugType": "portable", 
    "emitEntryPoint": true, 
    "preserveCompilationContext": true 
    }, 

    "dependencies": { 
    "AspNet.Security.OAuth.Validation": "1.0.0-alpha1-*", 
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Hosting": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-*", 
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-*", 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-*", 
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-*", 
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-*", 
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-*", 
    "OpenIddict.Core": "1.0.0-*", 
    "OpenIddict.EF": "1.0.0-*" 
    }, 

    "frameworks": { 
    "net451": { 
     "frameworkAssemblies": { 
     "System.ComponentModel": { "type": "build" } 
     } 
    }, 

    "netcoreapp1.0": { 
     "dependencies": { 
     "Microsoft.NETCore.App": { 
      "type": "platform", 
      "version": "1.0.0-rc2-*" 
     } 
     }, 

     "imports": [ 
     "dnxcore50", 
     "portable-net451+win8" 
     ] 
    } 
    }, 

    "tools": { 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 
     "version": "1.0.0-rc2-*", 
     "imports": "portable-net45+wp80+win8+wpa81+dnxcore50" 
    } 
    }, 

    "scripts": { 
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" 
    }, 

    "exclude": [ 
    "wwwroot", 
    "node_modules" 
    ], 

    "publishExclude": [ 
    "**.user", 
    "**.vspscc" 
    ] 
} 

Ich habe irgendwo gelesen, dass es aufgrund der Organisation meiner Abhängigkeiten sein könnte?

UPDATE

Dies ist der Fehler, den ich bekommen, wenn dotnet restore mit:

Errors in c:\Users\Dude\Documents\my-api-v1\src\MyApi\obj\060296a3-1ddd-4410-9e77-9510cd667f39\bin\project.json 
Microsoft.AspNetCore.Server.IISIntegration.Tools 1.0.0-rc2-20832 is not compatible with DNXCore,Version=v5.0. 
Some packages are not compatible with DNXCore,Version=v5.0. 
Microsoft.AspNetCore.Server.IISIntegration.Tools 1.0.0-rc2-20832 is not compatible with DNXCore,Version=v5.0 (win7-x64). 
Some packages are not compatible with DNXCore,Version=v5.0 (win7-x64). 
+0

Welchen genauen Befehl verwenden Sie, um Ihr Projekt zu veröffentlichen? – Pinpoint

+0

kein Befehl, ich verwende derzeit das Veröffentlichungswerkzeug vs 2015, für das ich noch kein CI eingestellt habe. Soll ich meine Veröffentlichungsprofileinstellungen veröffentlichen? –

Antwort

5

Sie verweisen ASP.NET Core-RC2-Pakete, die mit dem VS RC1 Tooling nicht kompatibel sind, da sie beide verlassen sich auf völlig unterschiedliche Stapel (DNX vs. .NET CLI).

Stattdessen sollten Sie in Betracht ziehen, dotnet publish zu verwenden.

Ich würde empfehlen, Ihre project.json Datei Aktualisierung der veralteten commands Abschnitt zu entfernen und die fehlende tools/scripts enthalten:

"tools": { 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 
    "version": "1.0.0-rc2-*", 
    "imports": "portable-net45+wp80+win8+wpa81+dnxcore50" 
    } 
}, 

"scripts": { 
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" 
} 

netstandardapp1.5 sollte auch durch die neue netcoreapp1.0 TFM und die folgende Abhängigkeit sollte ersetzt werden unter netcoreapp1.0/dependencies hinzugefügt:

"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-*" } 

Sie einen Blick auf https://github.com/openiddict/openiddict-core/blob/dev/samples/Mvc.Server/project.json f nehmen oder ein Arbeitsbeispiel.

+0

Danke, ich bekomme jetzt den Fehler 'Microsoft.Dnx.Runtime.FileFormatException: unbekanntes Schlüsselwort', den Sie [hier] besprochen haben (https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/issues/88). Irgendwelche Gedanken? –

+0

Es wird erwartet. Stoppen Sie die Verwendung von DNX/VS und ignorieren Sie sie und es sollte mit .NET CLI funktionieren. – Pinpoint

+0

heh, okay. Ich benutze die CLI jetzt und bekomme ein 'Einige Pakete sind nicht kompatibel mit DNXCore, Version = v5.0 (win7-x64)' Fehler. So frustrierend ... –