LoadFrom and UnsafeLoadFrom fail when loading a winmd file

626 views Asked by At

I am trying to load a .winmd file using Reflection in a C# 4.5 app (i'd like to read the metadata stored in it).

When using Assembly.LoadFrom and Assembly.UnsafeLoadFrom, the assembly loading fails with an exception:

Additional information: Could not load file or assembly 'file:///xxxxx.winmd' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

When using Assembly.ReflectionOnlyLoadFrom it succeeds.

What is the explanation for this behavior? and what is the proper way of loading a .winmd component to read its metadata?

0

There are 0 answers