【问题标题】:Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel' with 1.0.0-rc1-update1无法使用 1.0.0-rc1-update1 加载应用程序或执行命令“Microsoft.AspNet.Server.Kestrel”
【发布时间】:2016-01-09 20:07:15
【问题描述】:

我正在从 Azure 网站上的 kudo 日志文件中读取以下错误:

Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web.
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath)
   at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
   at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
   at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName)
   at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName)
   at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args)
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

我可以在本地运行我的网站:

C:\dev\ammo\ascend-ammo-wildlife>dnx web
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

project.json 看起来像使用 1.0.0-rc1-update1

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "artifacts",
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

有人可以指出事情的方向来验证它为什么会失败。

【问题讨论】:

    标签: azure web dnx


    【解决方案1】:

    将我的项目中的文件一一复制到一个工作的空项目中,我能够找出问题所在。

    项目中存在 global.json 是问题所在。

    大家还应该注意到,我的前端项目的项目结构是这样的:

    /
    /wwwroot/
    /src/ //Typescript files compiles into wwwroot
    /typings/ //tsd typings
    /global.json //This was the one that caused the issue, after deleting everything worked
    /tsd.json
    /tsconfig.json
    /startup.cs
    /project.json
    /package.json
    /gruntfile.js
    /bower.json
    /project.xproj
    /project.sln
    

    普通项目与典型项目具有 global.json 文件所在的父解决方案文件夹

    【讨论】:

    • 谢谢,这让我发疯了!
    猜你喜欢
    • 2016-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-27
    • 2016-03-31
    • 1970-01-01
    相关资源
    最近更新 更多