Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Add an environment variable to pass in the --appbase value to mono KRE #580

Closed
Praburaj opened this issue Aug 26, 2014 · 3 comments
Closed

Comments

@Praburaj
Copy link
Contributor

Currently there is no way to send the application base path to mono when launching k command. Automation in general needs this switch as the automation code is not in the same folder as the application itself.

Alternatively @davidfowl suggested an environment variable can be added to pass in the appbase value.

@Praburaj
Copy link
Contributor Author

Praburaj commented Sep 2, 2014

Cool. Thanks!

@Praburaj
Copy link
Contributor Author

Praburaj commented Sep 2, 2014

I used the updated bits to try this. I seem to be running into a different issue now.

I tried setting the environment variable

export KRE_APPBASE=/Users/username/Documents/../<ToApplicationPath>

Then running the below command (Expanded version of k kestrel)

/Users/ktest/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10335/bin/mono /Users/ktest/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10335/bin/klr.mono.managed.dll /Users/ktest/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10335/bin/Microsoft.Framework.ApplicationHost kestrel

When i try to run it from a folder other than the application folder I seem to be running into this below error:

System.Exception: Unable to locate project.json
  at Microsoft.Framework.Runtime.DefaultHost.Initialize (Microsoft.Framework.Runtime.DefaultHostOptions options, IServiceProvider hostServices) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.DefaultHost..ctor (Microsoft.Framework.Runtime.DefaultHostOptions options, IServiceProvider hostServices) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 

@Praburaj Praburaj reopened this Sep 2, 2014
@Praburaj
Copy link
Contributor Author

Praburaj commented Sep 2, 2014

Looks like I used the wrong KRE version for validation. I will validate this with the latest KRE and update the bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants