Create Publish.ps1

This commit is contained in:
ChsBuffer
2021-03-28 00:01:59 +08:00
parent d09b5adc33
commit 8746125dda
5 changed files with 20 additions and 6 deletions

View File

@@ -6,4 +6,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
</PropertyGroup>
</Project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
</configuration>

View File

@@ -87,6 +87,7 @@ namespace Netch
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += Application_OnException;
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(Global.MainForm);

View File

@@ -48,6 +48,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="TaskScheduler" Version="2.9.1" />
<PackageReference Include="Vanara.PInvoke.IpHlpApi" Version="3.3.7" />
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />

14
PUBLISH.ps1 Normal file
View File

@@ -0,0 +1,14 @@
Write-Host 'Building'
dotnet publish -c "Release" `
-p:Platform="x64" `
-p:PublishSingleFile=true `
-p:RuntimeIdentifier=win-x64 `
-p:SolutionDir="$pwd\" `
-o Netch\bin\Publish\ `
--no-self-contained `
Netch\Netch.csproj
if ($LASTEXITCODE) { exit $LASTEXITCODE }
Write-Host 'Build done'