簡體   English   中英

注冊使用 VS C# 2010 創建的 COM object

[英]Registering a COM object created with VS C# 2010

I created a COM object with C# yesterday which resulted in three files in the bin/release directory of my VS 2010 project (comclass.dll, comclass.pdb and comclass.tlb). Now, when I build the solution in the project, VS registers the class for me automatically on the development PC and I have no problem accessing the COM object and its methods from, let's say, Powershell. 但是,當我將這三個文件復制到另一台機器上並嘗試使用 regsvr32 注冊 dll 時,它告訴我

模塊“comclass.dll”已加載,但未找到入口點 DllRegisterServer。

確保“comclass.dll”是有效的 DLL 或 OCX 文件,然后重試。

regasm與 .tlb 文件上的/tlb參數一起使用會給我類似的消息。 所以我有點難過。 任何人都知道我應該如何從這里開始?

只需復制dll (如果您想要堆棧跟蹤中的文件路徑和行號,還可以選擇pdb )。 這是您注冊它的方式,並創建了tlb

"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\regasm.exe" comclass.dll /tlb /nologo /codebase

由於 Visual Studio 成功注冊它,這可能只是工作。 如果沒有,您還可以在進行 Rebuild 時打開 Output 面板並查看 Visual Studio 如何調用regasm

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM