SideBySide注册免费COM加载失败 [英] SideBySide Registration-Free COM fail while loading

查看:280
本文介绍了SideBySide注册免费COM加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个没有COM注册的Delphi应用程序使用的C#COM服务器。



这个过程描述在 ms博客 -
注册免费激活基于.NET的组件:演练



我创建了必需的清单文件,并将它们链接到程序集。



应用程式清单:

 <?xml version =1.0encoding =UTF-8standalone =yes > 
< assembly xmlns =urn:schemas-microsoft-com:asm.v1manifestVersion =1.0>
< assemblyIdentity
type =win32
name =Vorg
version =1.0.0.0/>
< dependency>
< dependentAssembly>
< assemblyIdentity
type =win32
name =Microsoft.Windows.Common-Controls
version =6.0.0.0
publicKeyToken =6595b64144ccf1df
language =*
processorArchitecture =x86/>
< / dependentAssembly>
< / dependency>
< dependency>
< dependentAssembly>
< assemblyIdentity
type =win32
name =Vorg.WpfClient
version =1.0.0.0/>
< / dependentAssembly>
< / dependency>
< trustInfo xmlns =urn:schemas-microsoft-com:asm.v3>
< security>
< requestedPrivileges>
< requestedExecutionLevel
level =asInvoker
uiAccess =false/>
< / requestedPrivileges>
< / security>
< / trustInfo>
< / assembly>

和装配清单:

 <?xml version =1.0encoding =UTF-8standalone =yes?> 
< assembly xmlns =urn:schemas-microsoft-com:asm.v1manifestVersion =1.0>
< assemblyIdentity type =win32name =Vorg.WpfClientversion =1.0.0.0/>
< clrClass
clsid ={69A72676-8EA7-3C38-BFBC-F0DFE745C329}
progid =Vorg.WpfClient
threadingModel =Both
name =KundM.Vorg.WpfClient.VorgComClient>
< / clrClass>
< / assembly>

那些工作正常(我想)。 sxs不报告任何错误。
clsid对于com类也是正确的。
但是当启动应用程序时,它是由一个ole异常0x8013101b崩溃。



删除清单并运行应用程序结果的curse在类中未找到异常。
注册的应用程序的com类注册的应用程序正常没有任何错误。



例外也许说错误的框架版本。

b
$ b

我试图在类清单中指定运行时。但是没有解决问题。



导致异常的原因是什么?



如何解决这个问题?



程序 http://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.100%29.aspxrel =nofollow> Fuslogvw.exe 给了我正确的方向。
此工具显示程序集的加载过程。



启用它需要创建reg键。



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
dword ForceLog = 1



生成的报告显示我这个(对不起德国框架) :

  LOG:DisplayName = vorg.wpfclient,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null 
(完全指定)
===
日志:Diese Bindung startet im default-Load-Kontext。
日志:Der Assembly - 下载wurdedurchgeführt。 Datei-Setup wird begonnen:E:\work\VOrg\bin\vorg.wpfclient.dll。
LOG:Die von der QuelleausgeführteSetup-Phase beginnt。
LOG:Der Assemblyname ist:Vorg.WpfClient,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 174d633867192b66。
WRN:Der Vergleich des Assemblynamensführtezum Konflikt:PUBLIC KEY TOKEN。
ERR:Der Assemblyverweis entsprach nicht der gefundenen Assemblydefinition。
ERR:Das Setup der Assembly konnte nicht abgeschlossen werden(hr = 0x80131040)。 Die Suche wurde beendet。

我没有在清单中指定公钥令牌。现在我做!
来自microsoft的清单的schemafile是错误的!它显示版本和一些其他属性作为可选。



我还指定了com清单中的运行时。
也可以通过app.config文件指定框架版本。




i'm trying to create a C# COM Server which is used by a Delphi App without a COM-Registration.

The process is descried on a ms blog - Registration-Free Activation of .NET-Based Components: A Walkthrough

I created the necessarily manifest files and i linked them to the assemblies.

The App 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="Vorg"
    version="1.0.0.0" />
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        processorArchitecture="x86"/>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
                <assemblyIdentity
                            type="win32"
                            name="Vorg.WpfClient"
                            version="1.0.0.0" />
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"/>
        </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

and the assembly 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="Vorg.WpfClient" version="1.0.0.0" />
    <clrClass
        clsid="{69A72676-8EA7-3C38-BFBC-F0DFE745C329}"
        progid="Vorg.WpfClient"
        threadingModel="Both"
        name="KundM.Vorg.WpfClient.VorgComClient">
    </clrClass>
</assembly>

those are working fine (i think). sxs does not report any errors. clsid is also correct for the com-class. but when starting the app, it is crashing by an ole exception 0x8013101b.

removing the manifests and running the app results of curse in a class not found exception. having the com-class registered the app starts normal without any errors.

the exception maybe says something like "wrong framework versions".

i tried to specify the runtime in the class manifest. but that didn't solve the problem.

what causes the exception?

how can i solve that problem?

解决方案

Solved.

The program Fuslogvw.exe gave me the right direction. this tool shows the loading process of assemblies.

to enable it you need to create a reg key.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion dword ForceLog=1

the report is generated there showed me this (sorry german framework):

LOG: DisplayName = vorg.wpfclient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Der Assembly-Download wurde durchgeführt. Datei-Setup wird begonnen: E:\work\VOrg\bin\vorg.wpfclient.dll.
LOG: Die von der Quelle ausgeführte Setup-Phase beginnt.
LOG: Der Assemblyname ist: Vorg.WpfClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=174d633867192b66.
WRN: Der Vergleich des Assemblynamens führte zum Konflikt: PUBLIC KEY TOKEN.
ERR: Der Assemblyverweis entsprach nicht der gefundenen Assemblydefinition.
ERR: Das Setup der Assembly konnte nicht abgeschlossen werden (hr = 0x80131040). Die Suche wurde beendet.

i did not specified the public key token in the manifests. now i do! the schemafile for manifests from microsoft is wrong! it shows version and some other attributes as optional.

i also specified the runtime within the com manifest. it is also possible to specify the framework version by a app.config file.

这篇关于SideBySide注册免费COM加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆