在VS 2008中有沒有一種方法可以指定我想在所生成的xap中包含所有/某些dll的pdb文件?如何將PDB文件包含在Silverlight XAP中?
背景
我們已經編寫了用於多個項目,一些基本的UI控件和功能的Silverlight框架。這些框架dll和pdbs通過svn:externals引入項目到一個lib文件夾中。 Silverlight應用程序通過將Copy Local設置爲True來引用項目lib文件夾中的dll。編譯時,dll包含在xap中,但是pdb不包含。如果我沒有滿足框架DLL的前提條件(即沒有設置控件的ItemSource),則會引發錯誤。我在VS 2008中的異常對話框中都選中了「拋出」和「用戶未處理」的CLR異常。在附加了VS 2008的情況下,我沒有收到錯誤報告。由於標準生成的Application_UnhandledException處理程序在附加調試程序時不會警告未處理的錯誤,並且由於某些原因VS不會在錯誤中斷。如果我手動將pdbs包含在xap中,則VS在正確的行上停止顯示錯誤。
Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles Me.UnhandledException
' If the app is running outside of the debugger then report the exception using
' the browser's exception mechanism. On IE this will display it a yellow alert
' icon in the status bar and Firefox will display a script error.
If Not System.Diagnostics.Debugger.IsAttached Then
' NOTE: This will allow the application to continue running after an exception has been thrown
' but not handled.
' For production applications this error handling should be replaced with something that will
' report the error to the website and stop the application.
e.Handled = True
Deployment.Current.Dispatcher.BeginInvoke(New Action(Of ApplicationUnhandledExceptionEventArgs)(AddressOf ReportErrorToDOM), e)
End If
End Sub
這似乎不起作用,至少不是在SL 4 – 2011-04-22 20:24:56
請仔細檢查MIME類型,「適用於我的機器」:-) – 2011-05-03 05:34:22
試過了,沒有運氣 – 2011-05-04 22:52:15