aspnetcore
aspnetcore copied to clipboard
Running "k" in a folder without a web/desktop app throws an unhandled exception
I accidentally ran k from the wrong folder, without a desktop or web application, and it got an unhandled exception, probably needs some error handling for that case.
C:\Users\Clint>k
Loaded Module: klr.net45.dll
Found DLL Export: CallApplicationMain
klr.exe Information: 0 : RootHost.Load name=Microsoft.Framework.ApplicationHost
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Clint\.kre\packages
\KRE-svr50-x86.0.1-alpha-build-0446\bin\Microsoft.Framework.ApplicationHost.dll)
klr.exe Information: 0 : RootHost.Load name=Microsoft.Framework.Runtime
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Clint\.kre\packages
\KRE-svr50-x86.0.1-alpha-build-0446\bin\Microsoft.Framework.Runtime.dll)
klr.exe Information: 0 : RootHost.Load name=Newtonsoft.Json
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Clint\.kre\packages
\KRE-svr50-x86.0.1-alpha-build-0446\bin\Newtonsoft.Json.dll)
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.Reflection.TargetInvocat
ionException: Exception has been thrown by the target of an invocation. ---> Sys
tem.Exception: Unable to locate project.json
at Microsoft.Framework.Runtime.DefaultHost.Initialize(DefaultHostOptions opti
ons)
at Microsoft.Framework.Runtime.DefaultHost..ctor(DefaultHostOptions options,
IServiceProvider hostProvider)
at Microsoft.Framework.ApplicationHost.Program.Main(String[] args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly ass
embly, String[] args, IServiceProvider serviceProvider)
at klr.host.Bootstrapper.Main(String[] args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at klr.hosting.RuntimeBootstrapper.Execute(String[] args)
at DomainManager.Main(Int32 argc, String[] argv)
Already a PR out for this https://github.com/aspnet/KRuntime/pull/205
Ok, thanks, didn't notice that one, I'll check it out.