Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel' with 1.0.0-rc1-update1

Tags:

web

azure

dnx

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 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.

like image 725
Poul K. Sørensen Avatar asked Jan 09 '16 20:01

Poul K. Sørensen


1 Answers

Copying file one by one from my project to a working empty project i was able to figure out what was the issue.

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

where normal vs projects typical have the parent solution folder where the global.json file was located

like image 113
Poul K. Sørensen Avatar answered Sep 23 '22 18:09

Poul K. Sørensen