Skip to content

Commit 53d6aae

Browse files
committed
修复了Release包生成失败的BUG
1 parent d11b105 commit 53d6aae

File tree

7 files changed

+50
-16
lines changed

7 files changed

+50
-16
lines changed

AfterBuild/MapBoard.AfterBuild.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
4-
<OutputType>Exe</OutputType>
3+
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
4+
<OutputType>WinExe</OutputType>
55
<AssemblyName>AfterBuild</AssemblyName>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
</PropertyGroup>

Common/MapBoard.Common.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
</PropertyGroup>
99
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1010
<OutputPath>..\Generation\Debug\</OutputPath>
11-
<LangVersion>preview</LangVersion>
1211
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
1312
<WarningLevel>4</WarningLevel>
1413
</PropertyGroup>
1514
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
1615
<OutputPath>..\Generation\Release\</OutputPath>
17-
<LangVersion>8.0</LangVersion>
1816
</PropertyGroup>
1917
<ItemGroup>
2018
<Reference Include="FzCoreLib.Windows">

GpxToolbox/MapBoard.GpxToolbox.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
</PropertyGroup>
99
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1010
<OutputPath>..\Generation\Debug\</OutputPath>
11-
<LangVersion>8.0</LangVersion>
1211
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
1312
<WarningLevel>4</WarningLevel>
1413
</PropertyGroup>
1514
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
1615
<OutputPath>..\Generation\Release\</OutputPath>
17-
<LangVersion>8.0</LangVersion>
1816
</PropertyGroup>
1917
<PropertyGroup>
2018
<StartupObject />

MapBoard/App.xaml.cs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
using FzLib.WPF.Dialog;
1+
using FzLib.Program.Runtime;
2+
using FzLib.WPF.Dialog;
23
using MapBoard.Common;
34
using ModernWpf.Controls;
45
using ModernWpf.FzExtension;
6+
using ModernWpf.FzExtension.CommonDialog;
57
using System;
68
using System.Globalization;
79
using System.Linq;
10+
using System.Threading.Tasks;
811
using System.Windows;
912

1013
namespace MapBoard.Main
@@ -25,7 +28,9 @@ private void Application_Startup(object sender, StartupEventArgs e)
2528
//};
2629
//return;
2730
#else
28-
UnhandledException.RegistAll(true);
31+
UnhandledException.RegistAll();
32+
UnhandledException.UnhandledExceptionCatched += UnhandledException_UnhandledExceptionCatched;
33+
2934
#endif
3035
Config.Instance.ThemeChanged += (p1, p2) =>
3136
{
@@ -57,5 +62,39 @@ private void Application_Startup(object sender, StartupEventArgs e)
5762
xcr.UseCompactResources = true;
5863
}
5964
}
65+
66+
private async void UnhandledException_UnhandledExceptionCatched(object sender, FzLib.Program.Runtime.UnhandledExceptionEventArgs e)
67+
{
68+
//await Task.Run(() =>
69+
//{
70+
// try
71+
// {
72+
// LogUtility.AddLog(e.Exception.Message, e.Exception.ToString());
73+
// }
74+
// catch (Exception ex)
75+
// {
76+
// }
77+
//});
78+
if (!e.Exception.Source.StartsWith("Microsoft.EntityFrameworkCore"))
79+
{
80+
await Dispatcher.Invoke(async () =>
81+
{
82+
try
83+
{
84+
await CommonDialog.ShowErrorDialogAsync(e.Exception, "程序出现异常");
85+
}
86+
catch
87+
{
88+
try
89+
{
90+
MessageBox.Show(e.Exception.ToString());
91+
}
92+
catch
93+
{
94+
}
95+
}
96+
});
97+
}
98+
}
6099
}
61100
}

MapBoard/MapBoard.Main.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
</PropertyGroup>
2020
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2121
<OutputPath>..\Generation\Debug\</OutputPath>
22-
<LangVersion>preview</LangVersion>
22+
<LangVersion>latest</LangVersion>
2323
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
2424
</PropertyGroup>
2525
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2626
<OutputPath>..\Generation\Release\</OutputPath>
27-
<LangVersion>8.0</LangVersion>
27+
<LangVersion>latest</LangVersion>
2828
</PropertyGroup>
2929
<PropertyGroup>
3030
<ApplicationIcon>icon.ico</ApplicationIcon>
@@ -61,7 +61,6 @@
6161
<Resource Include="icon.ico" />
6262
</ItemGroup>
6363
<ItemGroup>
64-
<ProjectReference Include="..\AfterBuild\MapBoard.AfterBuild.csproj" />
6564
<ProjectReference Include="..\EGIS.ShapeFileLib\EGIS.ShapeFileLib.csproj" />
6665
<ProjectReference Include="..\GpxToolbox\MapBoard.GpxToolbox.csproj" />
6766
<ProjectReference Include="..\Common\MapBoard.Common.csproj" />
@@ -115,7 +114,5 @@
115114
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
116115
<WarningLevel>4</WarningLevel>
117116
</PropertyGroup>
118-
<PropertyGroup>
119-
<PostBuildEvent>call AfterBuild.exe</PostBuildEvent>
120-
</PropertyGroup>
117+
<PropertyGroup />
121118
</Project>

ModernWpf.FzExtension/ModernWpf.FzExtension.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
</PropertyGroup>
99
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1010
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
11+
<OutputPath>..\Generation\Debug\</OutputPath>
12+
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
14+
<OutputPath>..\Generation\Release\</OutputPath>
1115
</PropertyGroup>
1216
<ItemGroup>
1317
<Reference Include="FzCoreLib.Windows">

TileDownloaderSplicer/MapBoard.TileDownloaderSplicer.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
</PropertyGroup>
99
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1010
<OutputPath>..\Generation\Debug\</OutputPath>
11-
<LangVersion>preview</LangVersion>
1211
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
1312
</PropertyGroup>
1413
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
1514
<OutputPath>..\Generation\Release\</OutputPath>
16-
<LangVersion>8.0</LangVersion>
1715
</PropertyGroup>
1816
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
1917
<WarningLevel>4</WarningLevel>

0 commit comments

Comments
 (0)