I am trying to access a file from an ASP.Net vNext class library using a relative path. The file is (should be) located in the installation folder of the application, and to build the full path I need to get that folder path.
Using System.Reflection.Assembly.GetExecutingAssembly()
, the Location
property is empty. The CodeBase
property contains the following:
CodeBase = "file:///C:/Users/username/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin/Microsoft.Dnx.Loader.dll"
How can I get the actual folder where the files being executed are located?
EDIT: The answers here are not valid for ASP.Net 5 as I explained already. - just for the duplicate flagging.