I also went through this a few days ago when I used
Environment.CurrentDirectory
since this was giving me a problem on a production server but working fine with my local server,
So, I tried using
System.AppDomain.CurrentDomain.BaseDirectory;
And he worked for me as in an environment.
So, since they all said that we should always go with
System.AppDomain.CurrentDomain.BaseDirectory;
as it checks the current domain directory for the path.
search for additional information
Could not find part of path error on server
BN 02 Sep '16 at 12:16 2016-09-02 12:16
source share