高分问题:用.net开发的类库文件dll,如何进行转换,使它即可以被.net使用,又可以被当作com组件被asp使用??谢谢!

gshope 2004-10-21 11:56:33
我参考过这篇文章:
http://search.csdn.net/Expert/topic/2559/2559637.xml?temp=.1949121
但是经这么转换后形成的是com组件,在.net里就不能被使用了!谁有好办法,谢谢!
...全文
147 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cancersyf 2004-10-21
  • 打赏
  • 举报
回复
http://www.codeproject.com/dotnet/cominterop.asp
cancersyf 2004-10-21
  • 打赏
  • 举报
回复
Creating a .net com component
1) In your .net project, select project/properties/configuration properties
select the build tab and check the box "Register for COM Interoperability"

In the .NET class add the following attributes for VB.NET:
Declaration:
Imports System.Runtime.InteropServices

Above the class definition add the following attribute:
<comClass()>

Above each method call add the following attribute:
<comVisible(True)>

Build copmonent using RegAsm.exe:
RegAsm dllfilename.dll /codebase
cancersyf 2004-10-21
  • 打赏
  • 举报
回复
1) Create a class library in VS choose whatever language you want either Vb.NEt or C#
2) Goto to Project Properties->ConfigurationProperties->build, check the Register for Com Interop checkbox. This creates the COM wrapper for your .NET assembly and hance need not use regasm.
3) Write whatever code you want, expose the classes publicly, expose the properties, functions you want publicly.
Eddie005 2004-10-21
  • 打赏
  • 举报
回复
没什么好办法,就up把........
gshope 2004-10-21
  • 打赏
  • 举报
回复
我发现只要在.net项目的属性-->配置属性-->生成-->为com interop注册,这项选true就可以了,但问题是,我要把这个dll部署到其它没有装vs2003的服务器上,应该怎么做呢??
3ss 2004-10-21
  • 打赏
  • 举报
回复
up
luluso 2004-10-21
  • 打赏
  • 举报
回复
mark

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧