Will
Will

Reputation: 79

How to get an assembly location in UWP?

I'm trying to update an outdated WPF SDK for UWP and I have this line of code: string path = System.Assembly.GetName().Location;

Anyone know of something similar which is generic enough to be used in an SDK for UWP?

Upvotes: 0

Views: 461

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

In UWP you could use typeof(Class).GetTypeInfo().Assembly.Location to get the location of specified Assembly.

And you could also use Windows.ApplicationModel.Package.Current.Installed­Location.Path to get the bundle of your project.

Upvotes: 2

Related Questions