12
我想我的部署dotnet的核心應用程序的Heroku,但保持對這種錯誤運轉起來:部署的dotnet核心的Heroku
Restore failed
unknown keyword platform
! Push rejected, failed to compile Web app app.
! Push failed
當我使用dotnet run
從CLI(我在Mac )一切運行良好。我已經包含下面我在Project.json
的情況下,可以幫助:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0",
"Microsoft.EntityFrameworkCore.Design": {
"version": "1.0.0-preview2-final",
"type": "build"
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2- final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"tooling": {
"defaultNamespace": "Tokens_monolith"
}
}
您是否在Heroku上安裝了dotnet-cli和.NET Core SDK/Runtime? – Tseng
我運行了'heroku buildpack:設置https:// github.com/jincod/dotnet-buildpack'來設置我的buildpack,然後直接從github部署我的代碼。它在錯誤出現之前開始運行'DNVM'。 – pgruber
這是一個重要的信息。當前的ASP.NET Core不再使用DNX。自RC2以來,(ASP).NET Core僅在dotnet-cli上運行。 DNX已棄用,不會進一步維護或開發。 DNVM是/是一個將安裝DNX運行時的DNX工具。可在此處找到.NET Core SDK/Runtime https://www.microsoft.com/net/core – Tseng