我正在从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"
]
}
有人可以向我指出事情的方向,以核实其失败的原因。
最佳答案
将文件从我的项目一个一个地复制到一个正在工作的空项目中,我能够弄清楚问题出在哪里。
问题在于项目中是否存在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
普通vs项目通常在其中放置了global.json文件的父解决方案文件夹
关于azure - 无法使用1.0.0-rc1-update1加载应用程序或执行命令 'Microsoft.AspNet.Server.Kestrel',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34698338/