gpt4 book ai didi

c# - 注册 免费 COM Interop : The application has failed to start because its side-by-side configuration is incorrect

转载 作者:太空狗 更新时间:2023-10-30 00:58:16 26 4
gpt4 key购买 nike

背景。我有一个用 C# 编写的名为 ComWrapper.dll 的 COM Wrapper 程序集,以及名为 Project1.exe 的 Visual Basic 6 应用程序。我已经添加了 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>

任何帮助将不胜感激。

最佳答案

您需要使用 sxstrace.exe 来确定错误的实际原因,(完整的)错误消息文本会告诉您这样做。这是错误的地方:

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.

问题在于 dependentAssembly 元素不应提供程序集的完整描述 - 它仅用于指示引用。您必须为该程序集提供一个单独的组件 list 文件,然后通过 clrClass 描述导出的 COM 类。这在 this MSDN article 中有更详细的描述。 .

关于c# - 注册 免费 COM Interop : The application has failed to start because its side-by-side configuration is incorrect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3199472/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com