mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Log first change exception
This commit is contained in:
@@ -6,6 +6,7 @@ using Wox.Core.Plugin;
|
||||
using Wox.Core.UserSettings;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure.Image;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.ViewModel;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
@@ -22,7 +23,8 @@ namespace Wox
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
RegisterAppDomainUnhandledException();
|
||||
RegisterAppDomainExceptions();
|
||||
|
||||
if (SingleInstance<App>.InitializeAsFirstInstance(Unique))
|
||||
{
|
||||
using (var application = new App())
|
||||
@@ -74,18 +76,31 @@ namespace Wox
|
||||
Current.Exit += (s, e) => Dispose();
|
||||
Current.SessionEnding += (s, e) => Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// </summary>
|
||||
[Conditional("RELEASE")]
|
||||
private void RegisterDispatcherUnhandledException()
|
||||
{
|
||||
// let exception throw as normal is better for Debug
|
||||
DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// </summary>
|
||||
[Conditional("RELEASE")]
|
||||
private static void RegisterAppDomainUnhandledException()
|
||||
private static void RegisterAppDomainExceptions()
|
||||
{
|
||||
// let exception throw as normal is better for Debug
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
|
||||
AppDomain.CurrentDomain.FirstChanceException += (s, e) =>
|
||||
{
|
||||
Log.Error("First Chance Exception:");
|
||||
Log.Exception(e.Exception);
|
||||
};
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -405,29 +405,30 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
xcopy /Y $(ProjectDir)Themes\* $(TargetDir)Themes\
|
||||
xcopy /Y /E $(ProjectDir)Images\* $(TargetDir)Images\
|
||||
xcopy /Y /D /E $(SolutionDir)Plugins\HelloWorldPython\* $(TargetDir)Plugins\HelloWorldPython\*
|
||||
xcopy /Y $(ProjectDir)Themes\* $(TargetDir)Themes\
|
||||
xcopy /Y /E $(ProjectDir)Images\* $(TargetDir)Images\
|
||||
xcopy /Y /D /E $(SolutionDir)Plugins\HelloWorldPython\* $(TargetDir)Plugins\HelloWorldPython\*
|
||||
|
||||
cd $(SolutionDir)packages\squirrel*\tools
|
||||
copy /Y Squirrel.exe $(TargetDir)..\Update.exe
|
||||
cd $(SolutionDir)
|
||||
|
||||
|
||||
if $(ConfigurationName) == Release (
|
||||
cd "$(TargetDir)Plugins" & del /s /q NLog.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q NLog.config
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Plugin.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Plugin.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Core.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Core.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q ICSharpCode.SharpZipLib.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q NAppUpdate.Framework.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Infrastructure.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Infrastructure.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q Newtonsoft.Json.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q JetBrains.Annotations.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Pinyin4Net.dll
|
||||
|
||||
cd "$(TargetDir)" & del /s /q *.xml
|
||||
)
|
||||
if $(ConfigurationName) == Release (
|
||||
cd "$(TargetDir)Plugins" & del /s /q NLog.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q NLog.config
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Plugin.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Plugin.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Core.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Core.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q ICSharpCode.SharpZipLib.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q NAppUpdate.Framework.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Infrastructure.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Wox.Infrastructure.pdb
|
||||
cd "$(TargetDir)Plugins" & del /s /q Newtonsoft.Json.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q JetBrains.Annotations.dll
|
||||
cd "$(TargetDir)Plugins" & del /s /q Pinyin4Net.dll
|
||||
cd "$(TargetDir)" & del /s /q *.xml
|
||||
)
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
@@ -438,11 +439,6 @@
|
||||
!-->
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' And '$(APPVEYOR_BUILD_FOLDER)' == '' ">
|
||||
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
|
||||
<Output TaskParameter="Assemblies" ItemName="myAssemblyInfo" />
|
||||
</GetAssemblyIdentity>
|
||||
<Exec Command="nuget pack $(SolutionDir)Deploy\wox.nuspec -Version %(myAssemblyInfo.Version) -Properties Configuration=Release -OutputDirectory $(TargetDir) -BasePath $(TargetDir)" />
|
||||
<Exec Command="squirrel --releasify $(TargetDir)Wox.%(myAssemblyInfo.Version).nupkg --releaseDir $(TargetDir)Installer --no-msi" />
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user