如何执行“使用ClickOnce部署COM组件"?在一个有名字的项目上? [英] How do I perform "Deploying COM Components with ClickOnce" on a strong name signed project?

查看:86
本文介绍了如何执行“使用ClickOnce部署COM组件"?在一个有名字的项目上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读 http://msdn.microsoft.com/zh-cn/library/ms165432.aspx ,我的测试C#项目与我们要从DLL ____摆脱的隔离COM组件完美地协同工作.

After reading http://msdn.microsoft.com/en-us/library/ms165432.aspx , my test C# project worked flawlessly with the isolated COM component that we want to get rid from the DLL ____.

然后我的下一步是将该方法移植到我们的主项目中,该项目是强名称+延迟签名.
结束语我尝试了以下步骤后得到:Visual Studio 2010只是无法生成由强名称签名的互操作文件.我不知道该怎么做.

Then my next step is to port this method to our main project which is strong name + delay signed.
Conclusion I got after trying steps below: Visual Studio 2010 just can't generate strong name signed interop files. I can't find out how to do it.

我尝试了这两种方法:

A.

  1. 我在C#项目设置中禁用了强名签名.
  2. 将组件添加到表单中,然后重新启用强名称签名.
  3. 由于生成的互操作文件不是强名称+延迟签名,导致编译失败严重.
  1. I disabled strong name signing in the C# project settings.
  2. Add the component into a form, then re-enable strong name signing.
  3. Compilation failed badly due to generated interop files were not strong name + delay signed.

错误:

ResolveComReferences:
  COM引用"XXXXXLib"是ActiveX控件"AxXXXXXLib"的互操作程序集,但已被编译器标记为带有/link标志的链接.此COM参考将被视为参考,并且不会链接.
c:\ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets(1558,9):警告MSB3283:找不到类型库"XXXXXLib"的包装程序集.
  C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin \ NETFX 4.0 Tools \ AxImp.exe"C:\ Blah \ XXXXX.ocx" /out:obj\Debug\AxInterop.XXXXXLib.dll/rcw:obj\Debug\Interop.XXXXXLib.dll/delaysign/keyfile:public.snk
AXIMP:AxImp错误:指定了无效的强名称参数.
c:\ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets(1558,9):警告MSB3283:找不到类型库"AxXXXXXLib"的包装程序集.

Error:

ResolveComReferences:
  COM Reference 'XXXXXLib' is the interop assembly for ActiveX control 'AxXXXXXLib' but was marked to be linked by the compiler with the /link flag. This COM reference will be treated as a reference and will not be linked.
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1558,9): warning MSB3283: Cannot find wrapper assembly for type library "XXXXXLib".
  C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\AxImp.exe "C:\Blah\XXXXX.ocx" /out:obj\Debug\AxInterop.XXXXXLib.dll /rcw:obj\Debug\Interop.XXXXXLib.dll /delaysign /keyfile:public.snk
AXIMP : AxImp error : Invalid strong name parameters specified.
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1558,9): warning MSB3283: Cannot find wrapper assembly for type library "AxXXXXXLib".

B.所以我尝试了另一种方法

B. So I tried the other way round

  1. 在项目中启用强名称签名.
  2. 当我尝试将COM组件拖到窗体上时,出现错误提示:无法导入ActiveX控件.确保已正确注册.
  1. Enabled strong name signing in project.
  2. As soon as i tried to drag the COM component to my form, error prompted: Failed to import ActiveX control. Make sure it is properly registered.

 

因此,我发现了这篇稍微过时的文章,该文章指示我如何使Visual Studio 2005自动生成强名称+延迟签名互操作性.
http://support.microsoft.com/kb/313666

So I found this slightly outdated article instructing me how to make Visual Studio 2005 to auto-generate strong name + delay signed interops.
http://support.microsoft.com/kb/313666

我在VS2010中找不到此包装器组装密钥文件字段的位置.

I can't find the location of this Wrapper Assembly Key File field in VS2010.

 

是的,我知道如何使用TLBIMP手动生成延迟签名的互操作文件,然后使用AxImp手动生成延迟签名的AxInterop文件.但是使用这两个非Visual Studio生成的互操作文件不允许我" ISOLATE " COM 组件,我打算使用ClickOnce部署COM组件".

Yes, I know how to manually generate a delay signed interop file with TLBIMP and then a delay signed AxInterop file with AxImp. But using these 2 non-Visual Studio generated interop files does not allow me to "ISOLATE " the COM component, which I intend to "Deploying COM Components with ClickOnce".

它们的文件类型在Visual Studio中的显示方式有所不同.

Their File Type appeared differently in Visual Studio.

  • 手动生成的互操作文件被视为程序集.
  • Visual Studio自动生成的互操作文件被视为ActiveX.

 

那么,如何根据C#项目中的签名设置正确配置VS2010以自动生成强名称+延迟签名的互操作文件?
还是我应该问,我该怎么做呢?谢谢.

So, how can i properly configure VS2010 to auto-generate strong name + delay signed interop files based on the signing settings in my C# project?
Or should I ask, how can I make this to work? Thanks.

推荐答案

<一个名称="x_x__MailAutoSig"> 嗨Motorolee,

 

感谢您的信息.

我认为此问题与CLR更相关,我将对其进行解决,

我们的工程师将在那里提供更多有用的信息.

 

最好的问候,

Ziwei Chen

 

 


这篇关于如何执行“使用ClickOnce部署COM组件"?在一个有名字的项目上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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