[英]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.