Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Reflection.Assembly.GetExecutingAssembly() in WinRT

There is no longer a static method on the Assembly class in WinRT for gaining access to the current executing assembly? What is the methodology for this in WinRT?

like image 986
keithwarren7 Avatar asked Sep 17 '11 00:09

keithwarren7


People also ask

What is Assembly GetExecutingAssembly ()?

In C#, GetExecutingAssembly() method is the method of Assembly class. This method returns the assembly that contains the code that is currently executing. To use this method we have to use System. Reflection in our program.

What is System reflection Assembly?

Namespace: System.Reflection. Summary. Defines an Assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.

How do you access the Assembly of a running application?

The recommended way to retrieve an Assembly object that represents the current assembly is to use the Type. Assembly property of a type found in the assembly, as the following example illustrates. To get the assembly that contains the method that called the currently executing code, use GetCallingAssembly.

What is the method to load Assembly by name?

Loads an assembly given its AssemblyName. The assembly is loaded into the domain of the caller using the supplied evidence. Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the application domain of the caller.


1 Answers

This should do the trick:

using System.Reflection;
...
typeof(Class).GetTypeInfo().Assembly

where Class would normally be the class that you're writing this code in.

like image 81
Pavel Minaev Avatar answered Oct 17 '22 01:10

Pavel Minaev