How to get executing assembly path (for robot)
Created at 22 Jun 2013, 21:04
How to get executing assembly path (for robot)
22 Jun 2013, 21:04
I found cAlgo doesn't like the Assembly namespace.
eg.
var a = Assembly.GetEntryAssembly().Location;
throws a NullReferenceException
For now all I can do is hardcode or perhaps use the Environment special folders perhaps.
Replies
algotrader
23 Jun 2013, 11:07
RE: RE:
SonnyJim said:
algotrader said:Why do you need Assembly.Location?
It's to load an xml file. Yes I can hard code the location, but...
I agree that hard coding location isn't good practice. You can put your xml file in Robots folder and find path to it using this code:
var pathToRobotsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "cAlgo", "Robots");
@algotrader
algotrader
22 Jun 2013, 22:34
Why do you need Assembly.Location?
@algotrader