您如何在Visual Studio 2010中开发可通过regasm在另一台PC上注册的C#dll? [英] How do you develop a C# dll in Visual Studio 2010 that can be registered on another pc via regasm?
问题描述
可能重复:
regasm RA0000:未注册任何类型
Possible Duplicate:
regasm RA0000: No types were registered
我有一个相当简单的组件,具有很强的命名能力,并内置到dll文件中.
I have a fairly simple component, strongly named and built into a dll file.
我将该文件提供给同事在他的Windows 7计算机上注册.
I give that file to a co-worker to register on his Windows 7 machine.
他使用以下命令:(从他将文件复制到的位置)
He uses the command: (from the location he has copied the file to)
regasm mycontrol.dll
得到回复
RegAsm:警告RA0000:未注册任何类型.
RegAsm : warning RA0000 : No types were registered.
为什么?
推荐答案
有人真的在Visual Studio 2010中开发了一个C#dll,可以通过regasm在另一台PC上注册吗?
Has anyone actually developed a C# dll in Visual Studio 2010 that could be registered on another pc via regasm?
是的,有人做过.
在创建互操作DLL时查看文档您可能错过了一步.一个常见的问题是忘记在assemblyInfo.cs
中将ComVisible
属性设置为true
.
Look at the documentaion on creating an interop DLL to see if there's a step you may have missed. A common problem is forgetting to set the ComVisible
property to true
in assemblyInfo.cs
.
一些关键部分:
这篇关于您如何在Visual Studio 2010中开发可通过regasm在另一台PC上注册的C#dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!