APSIMInitiative / APSIM710

APSIM
https://www.apsim.info
31 stars 47 forks source link

ApsimX: Relative paths fail when sims run from command line #1360

Closed ApsimBot closed 5 years ago

ApsimBot commented 5 years ago

Legacy Bug ID: 1928 Author: Justin Date: 2014-07-23 16:28:11 +0000 UTC

Running model.exe from a directory other than Bin causes relative paths to resolve incorrectly.

ApsimBot commented 5 years ago

Author: fai04d Date: 2014-07-24 10:13:00 +0000 UTC

Seems that they're using GetDirectory() so they get the directory the command was run in, not the directory of Model.exe.

ApsimBot commented 5 years ago

Author: fai04d Date: 2014-07-24 12:35:00 +0000 UTC

Fixed: Changed GetDirectory() to System.Reflection.Assembly.GetExecutingAssembly().Location