W. Winnie
W. Winnie

Reputation: 106

.Net Framework RegFree COM Manifest Match error

I'm trying to set up RegFree COM on a .Net Framework (4.8) library that is exposed to COM.

I've followed the instructions contained in:

Microsoft Learn

I've set up things in the way described. When it comes time to activate COM object CreateInstance returns '0x80131040 The located assembly's manifest definition does not match the assembly reference'.

I created the manifests for both client and component and made sure the component manifest was embedded as a resource in the component. Here is the component manifest:

<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" version="1.0.0.0" name="RegFreeCOMDemoFramework" processorArchitecture="msil"/>
    <clrClass clsid="{99A185F7-E91F-4988-BB4C-909139CCEC63}"
        progid="RegFreeCOMDemoFramework.FrameworkClass"
        threadingModel="Both"
        name="RegFreeCOMDemoFramework.RegFreeCOMDemoFramework"/>
    <file name="RegFreeCOMDemoFramework.dll"/>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" uiAccess="false">
                </requestedExecutionLevel>
            </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>

I also created a client manifest as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity type="win32" version="1.0.0.0" name="RegFreeCOMDemo_Driver" processorArchitecture="msil"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" version="1.0.0.0" name="RegFreeCOMDemoFramework" processorArchitecture="msil"/>
        </dependentAssembly>
    </dependency>
</assembly>

And then I added an exe.config file for the client executable:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0.30319"/>
    </startup>
</configuration>

So it seems I'm missing some notion about what it means for manifests to "match".

Upvotes: 0

Views: 54

Answers (1)

W. Winnie
W. Winnie

Reputation: 106

Alright, I got it to work.

The processorArchitecture attribute needed to be "amd64".

Upvotes: 1

Related Questions