简体   繁体   English

免费注册COM互操作:由于并排配置不正确,因此应用程序无法启动

[英]Registration Free COM Interop: The application has failed to start because its side-by-side configuration is incorrect

Background. 背景。 I've got a COM Wrapper assembly called ComWrapper.dll written in C#, and Visual Basic 6 application called Project1.exe. 我有一个用C#编写的COM Wrapper程序集ComWrapper.dll和一个名为Project1.exe的Visual Basic 6应用程序。 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. 我已经添加了Project1.exe.manifest文件(其内容如下所示),并且出现一条错误消息,指出“该应用程序由于并行配置不正确而无法启动。这是我的配置。

<?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. 任何帮助将非常感激。

You need to use sxstrace.exe to determine the actual cause of the error, as the (complete) error message text tells you to do. 您需要使用sxstrace.exe来确定错误的实际原因,因为(完整的)错误消息文本会告诉您这样做。 Here's what it is wrong: 这是错误的地方:

INFO: Parsing Manifest File INFO:解析清单文件

C:\\Temp\\sxs\\Project1.exe.Manifest. C:\\ Temp \\ sxs \\ Project1.exe。清单

INFO: Manifest Definition Identity is Project1.exe,processorArchitecture="x86",type="win32",version="1.0.0.0". 信息:清单定义身份是Project1.exe,processorArchitecture =“ x86”,类型=“ win32”,版本=“ 1.0.0.0”。

INFO: Reference: ComWrapper,processorArchitecture="msil",version="1.0.0.0" 信息:参考:ComWrapper,processorArchitecture =“ msil”,版本=“ 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. 错误:第9行:元素clrClass显示为元素urn:schemas-microsoft-com:asm.v1 ^ dependentAssembly的子级,此版本的Windows不支持该元素。

The problem is that dependentAssembly element should not provide a complete description of the assembly - it's only used to indicate a reference. 问题在于, dependentAssembly元素不应提供该程序集的完整描述-它仅用于指示引用。 You have to provide a separate component manifest file for that assembly, which then describes exported COM classes via clrClass . 您必须为该程序集提供一个单独的组件清单文件,然后通过clrClass描述导出的COM类。 This is described in more detail in this MSDN article . MSDN文章对此进行了更详细的描述。

This error could be due to a typo in the config file. 此错误可能是由于配置文件中的错字引起的。 Check your app.config file and look for typos. 检查您的app.config文件并查找拼写错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序无法启动,因为其并行配置不正确 - Application failed to start because its side-by-side configuration is incorrect 该应用程序无法启动,因为其并行配置不正确 - The application has failed to start because its side-by-side configuration is incorrect C#Dll导入失败:“应用程序无法启动,因为它的并行配置不正确” - C# Dll Import failure: “The application has failed to start because its side-by-side configuration is incorrect” 应用程序无法启动,因为它的并行配置不正确 - The application has failed to start because its side-by-side configuration is incorrect 并排配置不正确,导致应用程序启动失败 - application has failed to start because the side by side configauration is incorrect COM互操作并排组件 - COM interop side-by-side assemblies 从.Net COM dll回拨到Delphi客户端,无需注册(并排)COM - Callback from .Net COM dll to Delphi client in registration-free (side-by-side) COM 与C#和VBA并排COM互操作 - Side-By-Side COM Interop with C# and VBA 修复.NET应用程序中的并行错误 - Fix a side-by-side error in .NET application 免费注册COM Interop初始化-无参数构造函数 - Registration Free COM Interop Initialization - parameterless constructor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM