TypeLoadException using WinRT Brokered Component

0

I am building a Windows Store App using a brokered component. The brokered component is meant to enable interaction with an RFID reader on the device. When I try to initialize an instance of the class exposed by the brokered component, I received a System.TypeLoadException with the message Could not find or load a type. (Exception from HRESULT: 0x80131522).

I'm working against a clean installation of Windows 8.1 Professional on two different tablet devices. Both are currently experiencing this issue. The solution has worked in the past; something I've done recently must be causing this. I've also verified that the RFID reader can be accessed using a sample application provided by the hardware vendor.

My Package.appxmanifest file looks similar to this:

<Package ...>
  ...
  <Extensions>
    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>clrhost.dll</Path>
        <ActivatableClass ActivatableClassId="MyApp.RFID.Component.RfidDevice" ThreadingModel="STA">
          <ActivatableClassAttribute Name="DesktopApplicationPath" Type="string" Value="C:\Program Files (x86)\MyApp\RFID" />
        </ActivatableClass>
      </InProcessServer>
    </Extension>
  </Extensions>
</Package>

The solution is being built to target an x86 platform. I've registered my components on the target device under C:\Program Files (x86)\MyApp\RFID using the following commands (per this whitepaper):

icacls . /T /grant "ALL APPLICATION PACKAGES":RX

regsvr32 MyApp.RFID.Proxy.dll

I've installed the Visual Studio 2013 x86 Redistributable Package on the target device. I've also placed an additional dependency .dll in the same directory, just as I have been doing during all of my development.

Some other things I've tried:

  • Using %PROGRAMFILES% instead of C:\Program Files (x86) as the value for the ActivatableClassAttribute in the manifest.
  • Using 'STA', 'MTA', and 'Both' as the threading models.
  • Added a trailing slash to the ActivatableClassAttribute value path.
  • Completely uninstalled everything and tried again from scratch.
  • Explicitly add an empty default constructor to the RfidDevice class.
c#
windows-runtime
windows-store-apps
winrt-component
asked on Stack Overflow Jun 9, 2016 by Dustin Cleveland • edited Jun 10, 2016 by Dustin Cleveland

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0