2016-08-15 130 views
1

我在.NET Core中編寫了一個API,當我在本地運行時運行良好,但部署到Azure或Heroku給我在我的日誌中出現同樣的錯誤:No executable found matching command "dotnet-./..dll"。我在下面列出了我的project.json,我不確定其他信息會有幫助。謝謝!沒有可執行文件找到匹配命令「dotnet-./..dll」

{ 
    "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", 
    "Npgsql.EntityFrameworkCore.PostgreSQL": "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" 
    } 
} 
+0

「Microsoft.AspNetCore.Server.IISIntegration.Tools」版本中有空格。那是你的project.json實際上是這樣還是僅僅是一個錯字? –

+0

是的,那是一個錯字,謝謝。 – pgruber

+0

這個錯誤聽起來像你可能沒有在你的服務器上安裝'dotnet'工具。你如何設置服務器? –

回答

2

這裏的問題是.bin文件夾中的dll文件名稱與父文件夾名稱不同。我加入這行到我的project.json文件:

"buildOptions": { 
    "outputName": "whatever-you-want-it-to-be" 
} 

我重新建造我的應用程序,一切似乎是偉大的工作。所有的dll文件名都被更改了,所以我重新部署到了服務器上。希望這可以幫助!

相關問題