1

I have an app that uses a referenced library. That library in turn references a .winmd library.

Looking at the referenced library's IL, i can seee this reference:

.assembly extern windowsruntime FlurryWin8SDK
{
  .ver 0:9:0:0
}

At runtime however, i am getting an exception:

{"Could not load file or assembly 'FlurryWin8SDK' or one of its dependencies. The system cannot find the file specified.":"FlurryWin8SDK"}

Also, by using Procmon i see that there are attempts searching for FlurryWin8SDK.exe and FlurryWin8SDK.dll, but not for a file with .winmd extension.

Also, this is the output from Fusion logviewer:

BEGIN : Framework bind.
END   : The provided identity format is not recognized. (Exception from HRESULT: 0x80132003)
BEGIN : Windows Runtime Type bind.
END   : The provided identity format is not recognized. (Exception from HRESULT: 0x80132003)
BEGIN : Immersive bind.
END   : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

What could be the reason for this odd behaviour ?

lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
  • Have you found a solution? I have very similar problem in WP 8.1 with my own WinMD component. – Soonts Aug 13 '14 at 18:50

2 Answers2

2

It is not odd behavior. WinRT put a hard stop to DLL Hell, the kind of problem you cannot expect a store user to troubleshoot. A very hard requirement is that all dependencies are included with the app package. And Windows will only look in that package for the DLL.

This makes uses a .winmd file a bit less than useful. You'd only consider it in a large product that's built from many separate solutions that get packaged separately.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • A .winmd file doesn't contain any code, just declarations. Your program falls over when it tries to find the code. – Hans Passant Aug 02 '13 at 16:27
  • 1
    Flurry put their code in the .winmd file... I can see the actual code in Reflector. – lysergic-acid Aug 02 '13 at 16:29
  • 2
    I'm not familiar with anybody named "Flurry", sounds like a pet name :) No, a .winmd file only contains declarations. Easy to get it confused with a .NET assembly, the .winmd file format is identical to the .NET metadata format and can be viewed with a .NET disassembler. Maybe Flurry renamed such a .NET assembly, I really don't know. The error message certainly ought to be good evidence that it works like this. – Hans Passant Aug 02 '13 at 16:34
  • 1
    I meant www.flurry.com and by creating your own winmd components, it is possible to have both code and metadata in a winmd file. I believe this is the behavior in this case, as this is the only explanation since when i rename the winmd to dll, it loads fine and can be used correctly. Still this doesn't explain why the runime attempts to look for dll and not winmd... – lysergic-acid Aug 02 '13 at 18:08
2

Managed WinRT types can sometimes have code embedded in the winmd file. However if the .net assembly contains any public types that aren't WinRT types, they will be in a .Net assembly with the .Dll extension. It's possible that your component contains code in the DLL as well as the winmd file.

Larry Osterman
  • 16,086
  • 32
  • 60