Console Window shown when running GUI on Windows, (0.10.7)
See original GitHub issueWhen running GUI application on Windows, a Console window is also shown.
I am aware of previous issue which seems to have been (partially) resolved:
https://github.com/AvaloniaUI/Avalonia/issues/1705
However, AND FULL DISCLOSURE, what I am doing is building the application on LINUX and then running the output binary on Windows. If, however, I build AND run the app on Windows, the console window does not appear as expected.
However, it should be possible to build on one system and run on another correctly as .NET 5 offers this.
To Reproduce Here is my csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<ApplicationIcon>Assets/app.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.7"/>
<PackageReference Include="Avalonia.Desktop" Version="0.10.7"/>
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.7"/>
</ItemGroup>
</Project>
Here is the publish command, called on Linux:
dotnet publish -r win-x64 -c Release --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "AppImages/AppDir"
Expected behavior A console window in addition to min GUI window should not appear.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10 (built on Fedora 34)
- Version 0.10.7
Additional context Adding NSubsys package reference (as suggested elsewhere in link above) has no effect.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top GitHub Comments
I guess for now one could copy-paste the relevant source code from NSubsys and run it as a separate console app during the build process.
This looks to me like a problem with the .NET SDK. Most likely MS haven’t encountered it because they don’t have a cross-platform UI framework, I’d advise opening an issue at https://github.com/dotnet/sdk/issues