文章編號: 911721 - 上次校閱: 2006年3月13日 - 版次: 1.1 可能無法在執行階段存取公用屬性,而且您可能會收到錯誤訊息在 ASP.NET 2.0 架構的應用程式
在此頁中徵狀考慮下列案例。在 Microsoft ASP.NET 2.0 架構的應用程式,Web 網頁會包含 Microsoft Windows Form 使用者控制項物件。您可以使用 JavaScript 嘗試存取這個 Windows Form 使用者控制項物件的屬性。在這種情況下您可能無法在執行階段存取公用屬性。此外,您可能會收到下列的例外狀況錯誤訊息: 請參閱這封郵件而不是此對話方塊如需叫用剛的時間 (JIT) 偵錯的詳細資訊的結尾。 ************** 例外狀況文字 ************** 為型別的使用權限要求 System.Security.SecurityException: 'System.Security.permissions.SecurityPermission Mscorlib,版本 = 2.0.0.0 文化特性 = 中性 PublicKeyToken = b77a5c561934e089' 失敗。 at System.Windows.Forms.SafeNativeMethods.IFont.GetHFont() at System.Windows.Forms.Control.ActiveXImpl.get_AmbientFont() at System.Windows.Forms.Control.get_Font() at System.Windows.Forms.Control.GetParentFont() at System.Windows.Forms.Control.get_Font() at System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.CommonLayout() at System.Windows.Forms.ButtonInternal.ButtonStandardAdapter.PaintWorker(PaintEventArgs e, Boolean up, CheckState state) at System.Windows.Forms.ButtonInternal.ButtonStandardAdapter.PaintUp(PaintEventArgs e, CheckState state) at System.Windows.Forms.ButtonInternal.ButtonStandardAdapter.PaintOver(PaintEventArgs e, CheckState state) at System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.Paint(PaintEventArgs pevent) at System.Windows.Forms.ButtonBase.OnPaint(PaintEventArgs pevent) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 已失敗的動作: 要求 第一個失敗的使用權限的型別為: System.Security.Permissions.SecurityPermission ************** 載入的組件 ************** mscorlib 組件版本: 2.0.0.0 Win32 版本: 2.0.50215.44 (beta2.050215 4400) 程式碼基底: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50215/mscorlib.dll ---------------------------------------- 系統 組件版本: 2.0.0.0 Win32 版本: 2.0.50215.44 (beta2.050215 4400) 程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/system/2.0.0.0__b77a5c561934e089/system.dll ---------------------------------------- SmartClient 組件版本: 1.0.1928.26893 Win32 版本: 無 程式碼基底: http://localhost:1156/SmartClientTestWeb/SmartClient.dll ---------------------------------------- System.Windows.Forms 組件版本: 2.0.0.0 Win32 版本: 2.0.50215.44 (beta2.050215 4400) 程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing 組件版本: 2.0.0.0 Win32 版本: 2.0.50215.44 (beta2.050215 4400) 程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- Microsoft.mshtml 組件版本: 7.0.3300.0 Win32 版本: 7.0.3300.0 程式碼基底: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll ---------------------------------------- ************** JIT 偵錯 ************** 若要啟用剛的時間 (JIT) 偵錯,.config 檔案,此應用程式或電腦 (machine.config) 必須有將 system.windows.forms] 區段中設定 jitDebugging 值。應用程式也必須啟用偵錯編譯。 例如: <configuration>< system.windows.forms jitDebugging ="true"/ ></configuration> 啟用 JIT 偵錯時任何未處理的例外狀況將會被送到 JIT 偵錯工具在電腦上註冊而非由這個對話方塊。 發生的原因使用者控制項 的基底類別包含下列屬性,就會發生這個問題。 其他可行方案如果要解決這個問題,將下列屬性加入至 使用者控制項 類別。 其他相關資訊如果要重現問題的步驟
機器翻譯重要:本文是以 Microsoft 機器翻譯軟體翻譯而成,而非使用人工翻譯而成。Microsoft 同時提供使用者人工翻譯及機器翻譯兩個版本的文章,讓使用者可以依其使用語言使用知識庫中的所有文章。但是,機器翻譯的文章可能不盡完美。這些文章中也可能出現拼字、語意或文法上的錯誤,就像外國人在使用本國語言時可能發生的錯誤。Microsoft 不為內容的翻譯錯誤或客戶對該內容的使用所產生的任何錯誤或損害負責。Microsoft也同時將不斷地就機器翻譯軟體進行更新。 按一下這裡查看此文章的英文版本:911721?
(http://support.microsoft.com/kb/911721/en-us/
)
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。 | 其他資源 其他支援網站社群立即取得協助文章翻譯
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email



回此頁最上方
