Add Class library exception button to apps

This commit is contained in:
Dmitrii Chichuk 2020-01-09 01:34:00 +04:00
Родитель bfa0dabe1e
Коммит aba9216c0c
11 изменённых файлов: 59 добавлений и 10 удалений

Просмотреть файл

@ -117,8 +117,14 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contoso.WinForms.Puppet", "Apps\Contoso.WinForms.Puppet\Contoso.WinForms.Puppet.csproj", "{44E1971C-3399-4C88-AFE5-54EB53737D31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contoso.WPF.Demo", "Apps\Contoso.WPF.Demo\Contoso.WPF.Demo.csproj", "{AA7C64B6-2E77-4DA5-95ED-AA367D004A8F}"
ProjectSection(ProjectDependencies) = postProject
{A42BE92C-616D-4333-9F6A-D05BA547BFC6} = {A42BE92C-616D-4333-9F6A-D05BA547BFC6}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contoso.WPF.Puppet", "Apps\Contoso.WPF.Puppet\Contoso.WPF.Puppet.csproj", "{951ABE8D-7AF6-4162-8639-E78B022B1048}"
ProjectSection(ProjectDependencies) = postProject
{A42BE92C-616D-4333-9F6A-D05BA547BFC6} = {A42BE92C-616D-4333-9F6A-D05BA547BFC6}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contoso.WPF.Puppet.DotNetCore", "Apps\Contoso.WPF.Puppet.DotNetCore\Contoso.WPF.Puppet.DotNetCore.csproj", "{2A33F9A9-0E74-4CA3-B930-A7E153D54252}"
EndProject
@ -132,7 +138,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AppCenter.Test.Wi
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.AppCenter.Test.WindowsDesktop.Shared", "Tests\Microsoft.AppCenter.Test.WindowsDesktop.Shared\Microsoft.AppCenter.Test.WindowsDesktop.Shared.shproj", "{09F38506-8DEF-431D-A749-DF7E73A719F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contoso.UtilClassLibrary", "Apps\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj", "{A42BE92C-616D-4333-9F6A-D05BA547BFC6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contoso.UtilClassLibrary", "Apps\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj", "{A42BE92C-616D-4333-9F6A-D05BA547BFC6}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@ -981,6 +987,10 @@ Global
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|ARM.Build.0 = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|ARM64.Build.0 = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|iPhone.Build.0 = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|x64.ActiveCfg = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|x64.Build.0 = Debug|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Debug|x86.ActiveCfg = Debug|Any CPU
@ -991,6 +1001,10 @@ Global
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|ARM.Build.0 = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|ARM64.ActiveCfg = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|ARM64.Build.0 = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|iPhone.ActiveCfg = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|iPhone.Build.0 = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x64.ActiveCfg = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x64.Build.0 = Release|Any CPU
{A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x86.ActiveCfg = Release|Any CPU

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@ -133,6 +133,12 @@
<PackageReference Include="Microsoft.AppCenter.Push" Version="2.6.4" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj">
<Project>{A42BE92C-616D-4333-9F6A-D05BA547BFC6}</Project>
<Name>Contoso.UtilClassLibrary</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>

Просмотреть файл

@ -11,6 +11,7 @@
<Button Content="Track event" Click="TrackEvent" />
<StackPanel Orientation="Horizontal">
<Button Content="Throw exception" Click="ThrowException" />
<Button Content="Class library exception" Click="ClassLibraryException_Click" Margin="20,0,0,0" />
<ToggleSwitch Header="Handle all exceptions" x:Name="HandleExceptions" Margin="20,0,0,0" />
</StackPanel>
</StackPanel>

Просмотреть файл

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Contoso.UtilClassLibrary;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using System;
@ -42,6 +43,10 @@ namespace Contoso.UWP.Demo
// Handled errors in the forms app never hit that case because we need to use v16299 there.
await GenerateComplexException(2);
}
private void ClassLibraryException_Click(object sender, RoutedEventArgs e)
{
CrashUtils.BackgroundExceptionTask().RunSynchronously();
}
private async Task GenerateComplexException(int loop)
{

Просмотреть файл

@ -44,6 +44,11 @@ namespace Contoso.UWP.Puppet
await GenerateComplexException(2);
}
private void ClassLibraryException_Click(object sender, RoutedEventArgs e)
{
CrashUtils.BackgroundExceptionTask().RunSynchronously();
}
private async Task GenerateComplexException(int loop)
{
if (loop == 0)
@ -77,10 +82,5 @@ namespace Contoso.UWP.Puppet
await GenerateComplexException(loop - 1);
}
}
private void ClassLibraryException_Click(object sender, RoutedEventArgs e)
{
CrashUtils.BackgroundExceptionTask().RunSynchronously();
}
}
}

Просмотреть файл

@ -109,5 +109,11 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj">
<Project>{A42BE92C-616D-4333-9F6A-D05BA547BFC6}</Project>
<Name>Contoso.UtilClassLibrary</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -8,7 +8,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="App Center WPF Demo App" Height="494.797" Width="335">
Title="App Center WPF Demo App" Height="505" Width="335">
<StackPanel>
<TabControl SelectionChanged="TabControl_SelectionChanged">
<TabItem Header="App Center">
@ -82,6 +82,7 @@
<Button Content="Aggregate Exception" Margin="2" Click="CrashWithAggregateException_Click" />
<Button Content="Crash with null reference" Margin="2" Click="CrashWithNullReference_Click"/>
<Button Content="Async task crash" Margin="2" Click="CrashInsideAsyncTask_Click"/>
<Button Content="Class library exception" Margin="2" Click="ClassLibraryException_Click" />
</StackPanel>
</GroupBox>
</StackPanel>

Просмотреть файл

@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
@ -11,6 +10,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Contoso.UtilClassLibrary;
using Contoso.WPF.Demo.Properties;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
@ -244,6 +244,11 @@ namespace Contoso.WPF.Demo
}
}
private void ClassLibraryException_Click(object sender, RoutedEventArgs e)
{
CrashUtils.BackgroundExceptionTask().RunSynchronously();
}
private static class FakeService
{
public static async Task DoStuffInBackground()

Просмотреть файл

@ -122,6 +122,10 @@
<Project>{1e9ec0aa-3e32-4551-80c4-e4f3e53d7590}</Project>
<Name>Microsoft.AppCenter.WindowsDesktop</Name>
</ProjectReference>
<ProjectReference Include="..\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj">
<Project>{A42BE92C-616D-4333-9F6A-D05BA547BFC6}</Project>
<Name>Contoso.UtilClassLibrary</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -8,7 +8,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="App Center WPF Puppet App" Height="497.027" Width="335">
Title="App Center WPF Puppet App" Height="505" Width="335">
<StackPanel>
<TabControl SelectionChanged="TabControl_SelectionChanged">
<TabItem Header="App Center">
@ -82,6 +82,7 @@
<Button Content="Aggregate Exception" Margin="2" Click="CrashWithAggregateException_Click" />
<Button Content="Crash with null reference" Margin="2" Click="CrashWithNullReference_Click"/>
<Button Content="Async task crash" Margin="2" Click="CrashInsideAsyncTask_Click"/>
<Button Content="Class library exception" Margin="2" Click="ClassLibraryException_Click" />
</StackPanel>
</GroupBox>
</StackPanel>

Просмотреть файл

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Contoso.UtilClassLibrary;
using Contoso.WPF.Puppet.Properties;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
@ -244,6 +245,11 @@ namespace Contoso.WPF.Puppet
}
}
private void ClassLibraryException_Click(object sender, RoutedEventArgs e)
{
CrashUtils.BackgroundExceptionTask().RunSynchronously();
}
private static class FakeService
{
public static async Task DoStuffInBackground()