View Issue Details

IDProjectCategoryView StatusLast Update
0002057NoesisGUIUnitypublic2022-03-07 19:37
Reporterstonstad Assigned Tojsantos  
PrioritynormalSeveritymajor 
Status resolvedResolutionunable to reproduce 
Product Version3.1 
Target Version3.1 
Summary0002057: Noesis Dependency Logic Breaking Change
Description

XamlDependencies.cs
NoesisGuiExtensions.Dependency.Source

This property checks for the existence of a file using File.Exists(path). In prior versions of Noesis I use the following syntax:
<noesis:Dependency Source="/Assets/User Interface/Controls/ProductMenuControl.xaml"/>

This throws "[noesis] Dependency not found" errors. An alternative syntax shown below does not work either.
<noesis:Dependency Source="Assets/User Interface/Controls/ProductMenuControl.xaml"/>

Using a relative path does not eliminate the error, either:
<noesis:Dependency Source="../Assets/User Interface/Controls/ProductMenuControl.xaml"/>

Is this breaking change an intended behavior? The only workaround at present is to disable the File.Exists check.

PlatformAny

Activities

jsantos

jsantos

2021-07-07 22:11

manager   ~0007318

Last edited: 2021-07-07 22:13

This is not the intended behavior but it is part of the things we needed to change in the new version. So maybe we broke things.

The syntax "<noesis:Dependency Source="Assets/User Interface/Controls/ProductMenuControl.xaml"/>" should work, I don't understand why File.Exists is failing. The file does exist, right?

jsantos

jsantos

2021-07-07 22:12

manager   ~0007319

I assume this is 3.1 right? (this was originally marked as a 3.0.12 issue)

sfernandez

sfernandez

2021-07-08 00:55

manager   ~0007322

Could you open Unity C# project in Visual Studio, attach to Unity to put a breakpoint in XamlDependencies.cs, and check System.IO.Directory.GetCurrentDirectory() when debugger stops.
It should point to the opened Unity project, so calling File.Exist on paths like "Assets/Path/To/Some/Control.xaml" have to work if the file is there.

I just did some tests with absolute paths (starting with "/Assets/...") and relative paths and both worked fine in my project.

stonstad

stonstad

2021-07-08 17:00

reporter   ~0007323

I uncommented the lines in XamlDependencies.cs which performs the check and this time I received errors for three user controls instead of all referenced user controls. I can confirm the three user controls listed were not present and the errors shown are valid. Previously, I received errors for all user controls referenced.

I removed the incorrect dependencies and upon reimport I observed a NullReferenceException from OnInitialized, which appears to be due to invalid state in my code which is referenced during XAML preview. I added if (!Application.isPlaying) return; to OnInitialized and observed no further errors.

The current behavior looks bug free and correct. I am positive I received errors for all XAML dependencies initially, including the example cited above ("Assets/User Interface/Controls/ProductMenuControl.xaml") -- that one remains valid.

This is Noesis 3.0.12. It is MBI, and so they are not using the newest version of Noesis, yet. I'll be upgrading Stellar Conquest to 3.1 soon, and this will be an opportunity for me to retest the initial upgrade/import process again.

Environment.CurrentDirectory is correctly reported as the top-level directory of the Unity project, above .\Assets.

I am OK, because it is working.

jsantos

jsantos

2022-03-07 19:37

manager   ~0007834

Closing this for now. Please, reopen if necessary.

Issue History

Date Modified Username Field Change
2021-07-07 20:06 stonstad New Issue
2021-07-07 22:11 jsantos Note Added: 0007318
2021-07-07 22:11 jsantos Assigned To => jsantos
2021-07-07 22:11 jsantos Status new => feedback
2021-07-07 22:12 jsantos Note Added: 0007319
2021-07-07 22:12 jsantos Product Version 3.0.12 => 3.1
2021-07-07 22:12 jsantos Target Version => 3.1
2021-07-07 22:13 jsantos Note Edited: 0007318
2021-07-08 00:55 sfernandez Note Added: 0007322
2021-07-08 17:00 stonstad Note Added: 0007323
2021-07-08 17:00 stonstad Status feedback => assigned
2022-03-07 19:37 jsantos Status assigned => resolved
2022-03-07 19:37 jsantos Resolution open => unable to reproduce
2022-03-07 19:37 jsantos Note Added: 0007834
2025-10-10 13:29 jsantos Category Unity3D => Unity