2009-11-23 78 views
7

我有一個ActiveX控件,並用測試證書籤名,它的每一個,這是工作正常,但問題是,我的Internet Explorer顯示了一個醜陋的消息如何設置ActiveX控件名稱

網站想要運行下列如果您信任該網站和附加組件,並希望允許其運行,請點擊此處....

爲什麼控制系統無法使用「控制名稱不可用」名稱不可用?我已經在C#此ActiveX控件,並添加屬性標記有ComVisible特性到我的AssemblyInfo.cs,這裏是代碼

using System.Reflection; 
using System.Runtime.CompilerServices; 
using System.Security.Permissions; 
using System.Runtime.InteropServices; 
// 
// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information 
// associated with an assembly. 
// 
[assembly: System.Runtime.InteropServices.ComVisible(true)] 
[assembly: AssemblyTitle("My ActiveX Control")] 
[assembly: AssemblyDescription("My ActiveX Control Description")] 
[assembly: AssemblyConfiguration("")] 
[assembly: AssemblyCompany("CompanyXYZ")] 
[assembly: AssemblyProduct("My ActiveX Control")] 
[assembly: AssemblyCopyright("2009")] 
[assembly: AssemblyTrademark("CompanyXYZ")] 
[assembly: AssemblyCulture("")]  

// 
// Version information for an assembly consists of the following four values: 
// 
//  Major Version 
//  Minor Version 
//  Build Number 
//  Revision 
// 
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below: 

[assembly: AssemblyVersion("1.0.0.1")] 

請幫助我嗎?

回答

0

我可能是錯的,但如果我正確記得,COM名稱是從常規程序集屬性分開。一旦我在vb.net中編寫了一個activex,並能夠正確地查看描述和標題。

+0

你能幫我一下如何在C#中設置COM名稱嗎? – 2009-11-23 14:09:19

+0

任何解決方案Cem ???我在等? – 2009-11-23 18:24:06

+0

我沒有訪問.net工具了,所以我無法幫助更多關於這個問題。檢查屬性或從類屬性對話框,我不記得細節,對不起。 – 2009-11-24 06:46:34

3

你簽署了你的控制權嗎? Active X控件必須簽名,並且信息帶從簽名中獲取該信息。 This article真的很老(1996),但應該讓你朝着正確的方向前進。

編輯:

您可以添加您的控制預先覈準的名單作爲您的安裝,請參閱本document部分。

此外請確保註冊一個合適的ProgID

Edits2:

其實,從做一些閱讀它似乎託管擴展總是加載運行,所以IE把它看作運行。可能是與Active X相同的問題。

+0

是的我已經簽署了ActiveX控件..實際上.cab文件也是簽名的,它顯示正確的名稱..但是當它試圖運行它給這個提示.. – 2009-11-23 16:59:33

+0

是的我已經通過這個文件,並給了progID以及代碼簽名和其他東西在這個文件中...但cab文件是工作文件,它正在顯示名稱正確...但是當它詢問運行權限時,它的名字消失了。我剛剛在MFC中創建了一個ActiveX控件。它正確顯示其名稱..但我仍然不知道如何在C#中執行它。因爲我已經用C#編寫了幾乎完整的代碼並且工作正常,除了這個名稱問題... – 2009-11-23 18:23:21

1

嗨,訣竅是你需要簽署的不僅是ActiveX .cab文件,還包括它包含的.dll和.ocx文件。請參閱here