Page 1 of 2

Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 10 Oct 2025, 22:42
by adambuchweitz
I'm attempting to update from version from 3.2.6 to 3.2.9, and I'm getting errors now with declaring dependencies. Here is what I've had, and has worked as expected:
    <noesis:Xaml.Dependencies>
        <noesis:Dependency Source="/Assets/Dialogs/Alert/Alert.xaml"/>
    </noesis:Xaml.Dependencies>
After updating, I'm given the following errors:

Cannot create 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]', component not registered

Cannot set value for 'noesis:Preloader.Dependencies', invalid value '' for property type 'System.Collections.Generic.List`1[[NoesisGUIExtensions.Dependency, Noesis.NoesisGUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'

As you can probably guess, I use them to instantiate dialogs at runtime. I'm hoping the dependencies haven't been deprecated. Did the syntax change?

Thanks!

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 13 Oct 2025, 11:32
by jsantos
It seems we broke something related to this in version 3.2.9. A ticket has been created for it: #4411.

We’ll fix that, but indeed, Xaml.Dependencies isn’t needed at all. You can simply have strong references to the required XAML inside a ScriptableObject and load them from there.

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 13 Oct 2025, 18:16
by adambuchweitz
Thanks for the info. Does the ScriptableObject need to be instantiated to hold the strong reference? Most of my codebase is pure C# and avoids GameObjects everywhere possible, so the way
I have been opening dialogs looks something like this:
public class DialogCoordinator
{
  private Grid  _grid;
  
  public DialogCoordinator(Grid grid) => _grid = grid;
  
  public OpenPopup() =>
    _grid.Children.Add(new Alert());
}
Where Alert is a Xaml + code-behind combo:
public partial class Alert : UserControl
{
  public Alert() => InitializeComponent();
  
  private void InitializeComponent() => NoesisUnity.LoadComponent(this);
}

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 14 Oct 2025, 12:30
by jsantos
How are you handling other resources in Unity, such as meshes and textures? Unity typically requires hard references to these assets.
Does the ScriptableObject need to be instantiated to hold the strong reference?
No, that’s not necessary. You can also use the Preloaded Assets section in the project settings for this purpose.

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 15 Oct 2025, 17:47
by adambuchweitz
How are you handling other resources in Unity, such as meshes and textures? Unity typically requires hard references to these assets.
A couple hard references in XAML files, a few prefabs instantiated through Resources, and a whole lot of downloaded content loaded in at runtime, generated by users.
No, that’s not necessary. You can also use the Preloaded Assets section in the project settings for this purpose.
I have put MainWindow.xaml in the Preloaded Assets section, but instantiation (via `NoesisUnity.LoadComponent(this)` fails with:
[NOESIS] Xaml not found 'Assets/Menu/Noesis/MainWindow.xaml'
I tried variations of loading by keys "MainWindow" with and without extension, with and without full pathing, with and without "assets"

How exactly should a Xaml be instantiated after it's preloaded in this way? I don't believe that's in the docs.

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 15 Oct 2025, 17:54
by jsantos
You can use the Load method of NoesisXaml for this purpose:
public class NoesisXaml: ScriptableObject
{
    public object Load()
    {
        RegisterDependencies();

        NoesisUnity.Init();
        return Noesis.GUI.LoadXaml(new MemoryStream(content), uri);
    }

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 17 Oct 2025, 16:37
by stonstad
Hi there! Will there be a patch release for this fix?

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 17 Oct 2025, 18:13
by jsantos
Yes, 3.2.10 is coming next week.

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 20 Oct 2025, 21:17
by adambuchweitz
Yes, 3.2.10 is coming next week.
Thank you so much! I spent some time trying to load manually, and it works fine for individual dependencies, but becomes convoluted when a xaml contains deps which contain deps, etc.

Re: Unity: Xaml.Dependencies throws errors after updating to 3.2.9

Posted: 22 Oct 2025, 00:26
by jsantos
We already released 3.2.10.

Thanks everyone for the feedback!