mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Make console opening Windows + Debug only
This commit is contained in:
@@ -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<App>().UsePlatformDetect().LogToDebug();
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<DebugType>embedded</DebugType>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
|
||||
<DefineConstants>Windows</DefineConstants>
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64' AND '$(Configuration)' == 'Debug'">
|
||||
<DefineConstants>WindowsDebug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
|
||||
Reference in New Issue
Block a user