stride icon indicating copy to clipboard operation
stride copied to clipboard

Game Will Not Launch if PublishSingleFile is Enabled

Open MeharDT opened this issue 10 months ago • 3 comments

Release Type: Official Release

Version: 4.2.0.2122

Platform(s): Windows

Describe the bug If <PublishSingleFile>true</PublishSingleFile> or "Produce single file" is enabled when creating a build, the resulting executable will fail to launch.

To Reproduce Steps to reproduce the behavior:

  1. Start Stride 4.2.0.2122 and create a New Game project for Windows
  2. Once loaded, open Visual Studio and Publish the project to a local folder
  3. Ensure File publish options -> Produce single file is selected in Profile settings

Expected behavior Game should launch when the executable is opened.

MeharDT avatar Mar 31 '24 03:03 MeharDT

Can confirm this seems to have been an issue since 4.1, I have tried before.

Doprez avatar Mar 31 '24 04:03 Doprez

Event Viewer log,

Application: MyGame.Windows.exe
CoreCLR Version: 8.0.324.11423
.NET Version: 8.0.3
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException: The type initializer for 'Stride.Core.IO.VirtualFileSystem' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'Stride.Core.PlatformFolders' threw an exception.
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.ArgumentNullException.Throw(String paramName)
   at System.IO.Path.Combine(String path1, String path2)
   at Stride.Core.PlatformFolders.GetApplicationLocalDirectory() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\PlatformFolders.cs:line 109
   at Stride.Core.PlatformFolders..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\PlatformFolders.cs:line 31
   --- End of inner exception stack trace ---
   at Stride.Core.PlatformFolders.set_IsVirtualFileSystemInitialized(Boolean value) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\PlatformFolders.cs:line 90
   at Stride.Core.IO.VirtualFileSystem..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.IO\VirtualFileSystem.cs:line 85
   --- End of inner exception stack trace ---
   at Stride.Core.Storage.ObjectDatabase.CreateDefaultDatabase() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Serialization\Storage\ObjectDatabase.cs:line 85
   at Stride.Engine.Game.InitializeAssetDatabase() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\Game.cs:line 401
   at Stride.Engine.Game.PrepareContext() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\Game.cs:line 258
   at Stride.Games.GameBase.Run(GameContext gameContext)

MeharDT avatar Apr 09 '24 20:04 MeharDT

Just tested in Master and seems like this works mostly as expected. image

Above is compared to the 82 files that get generated without singlefile.

I dont know what the expectation was but this is definitely a lot better.

Doprez avatar May 15 '24 00:05 Doprez

Can this be closed? Did #2225 fix the issue?

Kryptos-FR avatar May 30 '24 10:05 Kryptos-FR

Can this be closed? Did #2225 fix the issue?

It's not included in a stable release yet but I think we have enough tests on source to consider it solved, I'll go ahead and close.

MeharDT avatar May 30 '24 15:05 MeharDT