views:

20

answers:

1

Background. I've got a COM Wrapper assembly called ComWrapper.dll written in C#, and Visual Basic 6 application called Project1.exe. I've added the Project1.exe.manifest file (contents of which are shown below), and I'm getting an error that says "the application has failed to start because its side-by-side configuration is incorrect. Here's my configuration.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32"
                    name="Project1.exe"
                    version="1.0.0.0"
                    processorArchitecture="x86" />
  <dependency>
    <dependentAssembly>
      <assemblyIdentity name="ComWrapper" version="1.0.0.0" processorArchitecture="msil"></assemblyIdentity>
      <clrClass clsid="{3ac3d04e-1f83-4a27-b516-95e38126685d}" progid="MyComObjectNamespace.myclass" threadingModel="Both" name="MyComObjectNamespace.myclass" runtimeVersion=""></clrClass>
      <file name="ComWrapper.dll" hashalg="SHA1"></file>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity name="mscorlib" version="2.0.0.0" publicKeyToken="b77a5c561934e089"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
    </dependentAssembly>
  </dependency>
</assembly>

Any help would be much appreciated.

+3  A: 

You need to use sxstrace.exe to determine the actual cause of the error, as the (complete) error message text tells you to do. Here's what it is wrong:

INFO: Parsing Manifest File

C:\Temp\sxs\Project1.exe.Manifest.

INFO: Manifest Definition Identity is Project1.exe,processorArchitecture="x86",type="win32",version="1.0.0.0".

INFO: Reference: ComWrapper,processorArchitecture="msil",version="1.0.0.0"

ERROR: Line 9: The element clrClass appears as a child of element urn:schemas-microsoft-com:asm.v1^dependentAssembly which is not supported by this version of Windows.

The problem is that dependentAssembly element should not provide a complete description of the assembly - it's only used to indicate a reference. You have to provide a separate component manifest file for that assembly, which then describes exported COM classes via clrClass. This is described in more detail in this MSDN article.

Pavel Minaev