none
RegAsm: "Cannot resolve dependency to Windows Runtime type: for .NET DLL

    Question

  • Hi,

    I have a .NET 4.5 class library with enabled use of Windows.winmd/WinRT APIs (PlatformTargetVersion=8.1). The DLL is COM Visible and I'm trying to use RegAsm to export reg/tlb files. However, when trying to run RegAsm I get the following output:

    regasm TestLib.dll /regfile:TestFile.reg /verbose


    Microsoft .NET Framework Assembly Registration Utility version 4.6.1038.0
    for Microsoft .NET Framework version 4.6.1038.0
    Copyright (C) Microsoft Corporation.  All rights reserved.

    RegAsm : error RA0000 : Cannot resolve dependency to Windows Runtime type 'Windows.Devices.Enumeration.DeviceInformation'. When using the ReflectionOnly APIs, dependent Windows Runtime assemblies must be resolved on demand through the ReflectionOnlyNamespaceResolve event.

    Is it me or the tool that's bugged and how am I to register for COM the DLL in this case?

    Thanks in advance, Kamen

    Wednesday, March 23, 2016 9:11 AM

Answers