Repository navigation
Problem with Content.Load #3362
|
I'm trying to load a UIPage asset from the project's files at runtime using Content.Load(), following the exact pattern of discussion#2233. Issue: Content.Load("path") always return null. I've already tried: Copy Asset URL, trying to pick different assets, changed assets path location, trying to load from differents scripts, update engine's version, full clean + rebuild solution in Visual Studio, manually deleted obj/Stride and bin/Debug/Data folders, tested by running both visual studio F5 and Game Studio's own play button, marked the asset as "Include in build as root asset", but nothing worked. [ContentManager]: Error: The asset '/MyProject/UI/ProgressBar/Page' could not be found. Asset path should be 'MyFolder/MyAssetName'. Check that the path is correct and that the asset has been included into the build. since Page ends up null, any code accessing uiComponent.Page.RootElement afterward throws a NullReferenceException at runtime (confirmed by running the compiled .exe directly, which surfaces the full unhandled exception without the IDE swallowing it): Informations: Stride 4.4.0-beta5 | .NET10.0.0 | Windows | Direct3D11 |
Replies: 6 comments 11 replies
|
Have you tried with a non-beta version? |
|
Would it be easy for you to send us a repro project? If you want to keep it private, you can trim it or send it directly to me over discord or by mail at virgile(at)stride3d.net |
|
Does it work using the path: "UI/Subject"? |
|
|
In your video, package is dirty (I can see a dirty asterisk next to package name in game studio) |
|
I think there is an issue when the asset is rooted and is not referenced in any other asset. |
@xen2 Having looked at the repo, this might be a regression.
It looks like assets marked as root assets filled in the
Windows.sdpkg(like this project) doesn't get added to content manager.If you set 'current project' to the Game project then mark as root so it gets added to the
Game.sdpkgfile, then it gets detected.