Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishSingleFile removes icon #2304

Closed
YerkoAndrei opened this issue Jun 4, 2024 · 5 comments · Fixed by #2352
Closed

PublishSingleFile removes icon #2304

YerkoAndrei opened this issue Jun 4, 2024 · 5 comments · Fixed by #2352
Labels
bug Something isn't working

Comments

@YerkoAndrei
Copy link
Contributor

Release Type: Official Release

Version: 4.2.0.2149

Platform(s): Windows

Describe the bug
When publishing a game with <PublishSingleFile>true</PublishSingleFile> the icon does not appear in the title bar nor the task bar of Windows.

To Reproduce
Steps to reproduce the behavior:

  1. Create project
  2. Create Publish profile with PublishSingleFile set to true
  3. Publish and play

Expected behavior
The default icon should me visible in the title bar and the task bar.

Screenshots
imagen

Additional context
The build works as expected, except for the icon.
The build works as expected when PublishSingleFile is set to false.
The .exe shows the icon as expected.
Changing the icon does nothing.
Seting the .ico as resource and/or including it in the publish folder does nothing.

This a simple publish profile:

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>..\Bin\Windows\Publish\</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <_TargetId>Folder</_TargetId>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <SelfContained>false</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishReadyToRun>false</PublishReadyToRun>
  </PropertyGroup>
</Project>
@YerkoAndrei YerkoAndrei added the bug Something isn't working label Jun 4, 2024
@Kryptos-FR
Copy link
Member

Kryptos-FR commented Jun 4, 2024

Did you try setting the <Application icon> property on the project file?

edit: never mind, it's set by default in the game template.

It does feel like a .NET issue, not a Stride specific one.

@YerkoAndrei
Copy link
Contributor Author

idk if its relevant but in a .NET 8 WPF build it doesnt happen

@MeharDT
Copy link
Contributor

MeharDT commented Jun 5, 2024

Workaround: publish with SDL, the bug seems exclusive to Windows Forms builds.

You can do this by opening the App.cs file in your Windows project and changing game.Run(); to game.Run(GameContextFactory.NewGameContextSDL());

@YerkoAndrei
Copy link
Contributor Author

Fullscreen doesnt work on SDL (but the icons show hehe)
I got this when changing to fullscreen:

Stride.Graphics.GraphicsException: 'Unexpected error on Present (device status: Normal)'

SharpDXException: HRESULT: [0x887A0001], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_INVALID_CALL/InvalidCall], Message: La aplicación realizó una llamada no válida. Los parámetros de la llamada o el estado de algún objeto no eran correctos.
Habilite la capa de depuración D3D para conocer los detalles mediante mensajes de depuración.

@MeharDT
Copy link
Contributor

MeharDT commented Jun 5, 2024

Ah that's right, I forgot about that. I believe the SDL fullscreen bug is being tackled here,

#2008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants