Get build location in CoreCLR

In CoreCLR, I cannot get the assembly location, as it was in the .NET Framework.

It appears that Location is not a member of Assembly, and that static methods on Assembly, such as GetExecutingAssembly, have also not disappeared.

What is the preferred method for getting the assembly directory or any information about the directory of my program?

I tried CoreCLR versions:
1.0.0-beta5 coreclr x64
1.0.0-beta6 coreclr x86

+4
source share
1 answer

As you mention 1.0.0-beta6, I assume you are talking about DNX.

You can use IApplicationEnvironment . This will give you the name and base path of the application.

Assembly.Location , , , , .

+2

All Articles