From ef7cdcb2e14e9ee45ce88d99d9e6d5115d1b3060 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 29 Jun 2021 13:49:37 -0700 Subject: [PATCH] Make console opening Windows + Debug only --- RedBookPlayer/Program.cs | 10 +++++----- RedBookPlayer/RedBookPlayer.csproj | 10 +++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/RedBookPlayer/Program.cs b/RedBookPlayer/Program.cs index 111558d..532003a 100644 --- a/RedBookPlayer/Program.cs +++ b/RedBookPlayer/Program.cs @@ -1,4 +1,4 @@ -#if Windows +#if WindowsDebug using System.Runtime.InteropServices; #endif using Avalonia; @@ -10,17 +10,17 @@ namespace RedBookPlayer { public static void Main(string[] args) { - #if Windows +#if WindowsDebug AllocConsole(); - #endif +#endif BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } - #if Windows +#if WindowsDebug [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool AllocConsole(); - #endif +#endif public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure().UsePlatformDetect().LogToDebug(); } diff --git a/RedBookPlayer/RedBookPlayer.csproj b/RedBookPlayer/RedBookPlayer.csproj index 0494bd3..c313adc 100644 --- a/RedBookPlayer/RedBookPlayer.csproj +++ b/RedBookPlayer/RedBookPlayer.csproj @@ -1,17 +1,13 @@ - + WinExe netcoreapp3.1 true win-x64;linux-x64 - linux-x64 embedded - true - true - true - - Windows + + WindowsDebug