xaml x:Name on UserControl results in compiler error
Posted: 12 Aug 2021, 20:53
Why does this fail in error in the "Blend"-project?
<local:Search x:Name="search" />
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Assets' does not exist in the namespace 'SystemTwo.Assets.Scenes.SystemTwo' (are you missing an assembly reference?) SystemTwo-blend C:\Projects\Unity\Noesis\SystemTwo 0.4\SystemTwo\Assets\Scenes\SystemTwo\Scripts\NoesisGUI\CaseView.xaml 28 Active
If I just leave out the name and write
<local:Search />
it works just fine.
This only results in error when I run the Blend-project (In VS, have not tried Blend), if I run the same code with Unity with the Noesis VS-project it works fine.
For now I don't even use the "search" name reference, which is also why it took me a long time to figure out that the reference was the problem.
Steps to reproduce:
Create whatever container xaml file and include a Usercontrol and put x:Name on the xaml referenceobject inside the container.
<local:Search x:Name="search" />
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Assets' does not exist in the namespace 'SystemTwo.Assets.Scenes.SystemTwo' (are you missing an assembly reference?) SystemTwo-blend C:\Projects\Unity\Noesis\SystemTwo 0.4\SystemTwo\Assets\Scenes\SystemTwo\Scripts\NoesisGUI\CaseView.xaml 28 Active
If I just leave out the name and write
<local:Search />
it works just fine.
This only results in error when I run the Blend-project (In VS, have not tried Blend), if I run the same code with Unity with the Noesis VS-project it works fine.
For now I don't even use the "search" name reference, which is also why it took me a long time to figure out that the reference was the problem.
Steps to reproduce:
Create whatever container xaml file and include a Usercontrol and put x:Name on the xaml referenceobject inside the container.