如何将.NET程序集注册为COM? [英] How to register a .NET assembly as COM?

查看:99
本文介绍了如何将.NET程序集注册为COM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地计算机上为工作流创建了一个类库,并进行了构建。我将完整的解决方案移至Tridion服务器,并尝试使用regasm.exe工具在服务器中注册程序集,如下所示:

I have created a class library for a workflow on a local machine and build that. I moved the complete solution to a Tridion server and tried to register the assembly in the server using regasm.exe tool as below:

C:\User\XYZ\Desktop\>RegAsm \codebase F:\Workflow\WorkflowHandler/bin/debug/WorkflowHandler.dll

我遇到以下错误:


无法加载'F:\ Workflow\WorkflowHandler / bin / debug / WorkflowHandler.dll
',因为它不是有效的.NET程序集。

failed to load 'F:\Workflow\WorkflowHandler/bin/debug/WorkflowHandler.dll ' because it is not a valid .NET Assembly.

我的服务器详细信息:

64位, Windows Server 2008 R2 企业版和.NET Framework 4已安装。

64-bit, Windows Server 2008 R2 Enterprise, and .NET Framework 4 installed.

推荐答案

您确定您拥有正确的 RegAsm ,因为您仅通过exe名称调用它,而未指定完整路径?您必须调用正确的RegAsm版本才能使其正常工作,即32或64位版本的.NET 4。

Are you sure you have the right RegAsm in your path since you're calling it by exe name only without specifying the full path? You must call the right version of RegAsm for it to work, i.e 32 or 64-bit version of .NET 4.

尝试指定完整路径:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase F:\Workflow\WorkflowHandler\bin\debug\WorkflowHandler.dll

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /codebase F:\Workflow\WorkflowHandler\bin\debug\WorkflowHandler.dll

我也注意到在您的路径中汇编中,您有一些 / 字符,而不是 \ 。确保输入正确的路径。

Also I noticed that in the path to your assembly you had some / characters instead of \. Make sure you're putting in the correct path.

这篇关于如何将.NET程序集注册为COM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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