无法加载应用程序或执行命令'Microsoft.AspNet.Server.Kestrel“与1.0.0-RC1-UPDATE1 [英] Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel' with 1.0.0-rc1-update1
问题描述
我从日志文件阅读下面的错误工藤在Azure上的网站:
I am reading the following error from logfiles in kudo on azure websites:
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)
我可以在本地运行我的网站:
I can run my site locally:
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
project.json looks like following and using 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"
]
}
有人能指出我的东西方向,以验证弄清楚为什么它的失败。
Can someone point me in directions of things to verify to figure out why its failing.
推荐答案
复制文件一个个从我的项目工作的空项目,我是能够弄清楚究竟是什么问题。
Copying file one by one from my project to a working empty project i was able to figure out what was the issue.
在项目中的global.json的presence是问题。
The presence of a global.json in the project was the issue.
人们还应该注意到,我的项目内在张力结构看起来像这样的前端项目:
One should also notice that my project sturcture looks like this for frontend projects:
/
/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文件所在的父文件夹的解决方案。
where normal vs projects typical have the parent solution folder where the global.json file was located
这篇关于无法加载应用程序或执行命令'Microsoft.AspNet.Server.Kestrel“与1.0.0-RC1-UPDATE1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!