stride
stride copied to clipboard
Game Will Not Launch if PublishSingleFile is Enabled
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:
- Start Stride 4.2.0.2122 and create a New Game project for Windows
- Once loaded, open Visual Studio and Publish the project to a local folder
- Ensure File publish options -> Produce single file is selected in Profile settings
Expected behavior Game should launch when the executable is opened.
Can confirm this seems to have been an issue since 4.1, I have tried before.
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)
Just tested in Master and seems like this works mostly as expected.
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.
Can this be closed? Did #2225 fix the issue?
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.