2013-06-20 19 views
1

我在C#中創建了一個excel插件。它使用dllimport使用C++ dll本機代碼。它在我的本地機器上正常工作。現在我想在另一臺PC /客戶端PC上使用它。我也嘗試過regasm。我註冊成功如下:如何將dll用作不同機器的加載項?

C:\windows\system32>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm /code 
base C:\Users\ggirgup\Desktop\CsharpDllcallingCPPDll.dll 
Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.17929 
for Microsoft .NET Framework version 4.0.30319.17929 
Copyright (C) Microsoft Corporation. All rights reserved. 

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can ca 
use your assembly to interfere with other applications that may be installed on 
the same computer. The /codebase switch is intended to be used only with signed 
assemblies. Please give your assembly a strong name and re-register it. 
Types registered successfully 

但是,當我打開excel,它不會在插件中顯示。 那麼如何在另一臺PC上使用這個C#dll作爲excel-plugin?

在此先感謝所以!

回答

0

你在看什麼插件窗口?爲了確保我們談論的是正確的,請轉到功能區上的「開發人員」選項卡(如果此選項不可見,請轉到Excel選項 - >常用選項,並選中功能區中的「顯示開發人員選項卡」),然後單擊「Visual基本「項目在最左邊。一旦VB Developer窗口打開,進入工具 - >參考。這將打開所有可用的參考。如果你沒有看到你的,那麼你必須點擊「瀏覽」才能看到它。我用regasm使用/ tlb選項並瀏覽regasm輸出的.tlb文件,並將其作爲參考添加到我的工作中。不知道如果沒有TLB,它會起作用,但我不明白爲什麼不行。