找不到可执行的匹配命令“dotnet - 。/ .. dll” [英] No executable found matching command "dotnet-./..dll"

查看:1340
本文介绍了找不到可执行的匹配命令“dotnet - 。/ .. dll”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET Core中编写了一个API,在我本地运行时效果很好,但是部署到Azure或Heroku给了我日志中的相同错误:没有找到可执行的匹配命令dotnet-./ ..dll。我在下面列出了我的project.json,我不确定其他信息会有帮助。

I wrote an API in .NET Core that works great when I run locally, but deploying to Azure or Heroku gives me the same error in my logs: No executable found matching command "dotnet-./..dll". I've included my project.json below, I'm not sure what other information would be helpful. Thanks!

{
  "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"
  }
}


推荐答案

这里的问题是 .bin 文件夹中的dll文件命名与父文件夹名称不同。我将这一行添加到我的 project.json 文件中:

The issue here was that the dll files in .bin folder were named differently than the parent folder name. I added this line to my project.json file:

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

我重新构建了我的应用程序,所有内容似乎都很棒。所有的dll文件名都被更改了,所以我重新部署到了服务器上。希望这有助于!

I re-built my app and everything seems to be working great. All of the dll file names were changed so I re-deployed to the server. Hope this helps!

这篇关于找不到可执行的匹配命令“dotnet - 。/ .. dll”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆