Browse Source

fix Silverlight Application project template for VB

4.1
Siegfried Pammer 15 years ago
parent
commit
3302aa05c0
  1. 18
      data/templates/project/VB/SilverlightApplication.xpt

18
data/templates/project/VB/SilverlightApplication.xpt

@ -25,6 +25,12 @@
<Reference Include="System.Net" /> <Reference Include="System.Net" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Windows.Browser" /> <Reference Include="System.Windows.Browser" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ProjectItems> </ProjectItems>
<PropertyGroup escapeValue="False"> <PropertyGroup escapeValue="False">
@ -55,15 +61,15 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup configuration="Debug" escapeValue="false"> <PropertyGroup configuration="Debug" escapeValue="false">
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> <DefineConstants>DEBUG,TRACE,SILVERLIGHT</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false"> <PropertyGroup configuration="Release" escapeValue="false">
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants> <DefineConstants>TRACE,SILVERLIGHT</DefineConstants>
</PropertyGroup> </PropertyGroup>
<Imports clear="True"> <Imports clear="True">
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.VisualBasic.targets" />
</Imports> </Imports>
<Files> <Files>
@ -111,16 +117,14 @@ Public Partial Class App
Private Sub Application_UnhandledException(sender As Object, e As ApplicationUnhandledExceptionEventArgs) Private Sub Application_UnhandledException(sender As Object, e As ApplicationUnhandledExceptionEventArgs)
If Not System.Diagnostics.Debugger.IsAttached Then If Not System.Diagnostics.Debugger.IsAttached Then
e.Handled = True e.Handled = True
Deployment.Current.Dispatcher.BeginInvoke(Function() Do Deployment.Current.Dispatcher.BeginInvoke(Sub() ReportErrorToDOM(e))
ReportErrorToDOM(e)
End Function)
End If End If
End Sub End Sub
Private Sub ReportErrorToDOM(e As ApplicationUnhandledExceptionEventArgs) Private Sub ReportErrorToDOM(e As ApplicationUnhandledExceptionEventArgs)
Try Try
Dim errorMsg As String = e.ExceptionObject.Message + e.ExceptionObject.StackTrace Dim errorMsg As String = e.ExceptionObject.Message + e.ExceptionObject.StackTrace
errorMsg = errorMsg.Replace(""""C, "'"C).Replace(vbCr & vbLf, "\n") errorMsg = errorMsg.Replace(""""C, "'"C).Replace(vbCrLf, "\n")
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(""Unhandled Error in Silverlight Application " & errorMsg & """);") System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(""Unhandled Error in Silverlight Application " & errorMsg & """);")
Catch generatedExceptionName As Exception Catch generatedExceptionName As Exception

Loading…
Cancel
Save