1

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?

lysergic-acid
  • 19,570
  • 21
  • 109
  • 218

0 Answers0