Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading WinRT assembly from .NET

How does one load a WinRT assembly by name? When I do the following:

(new TextBlock()).GetType().GetTypeInfo().Assembly

Then I get the assembly Windows.UI.Xaml.Controls. But if I try to load it by name:

var name = new AssemblyName { 
   Name = "Windows.UI.Xaml.Controls", 
   Version = new Version(255, 255, 255, 255), 
   ContentType = AssemblyContentType.WindowsRuntime 
};

Then it says "Operation not supported". This happens even if I do this:

var name = (new TextBlock()).GetType().GetTypeInfo().Assembly.GetName();
Assembly.Load(name);

How can I get at WinRT assemblies by name?

like image 598
Jules Avatar asked Dec 11 '11 23:12

Jules


1 Answers

As it currently stands (Windows 8 Developer Preview from Fall 2011), WinRT doesn't allow you to dynamically load and execute code.

like image 112
Judah Gabriel Himango Avatar answered Oct 11 '22 13:10

Judah Gabriel Himango