[email protected]
Topic Author
Posts: 19
Joined: 16 Jan 2019, 23:16

xaml x:Name on UserControl results in compiler error

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.
 
[email protected]
Topic Author
Posts: 19
Joined: 16 Jan 2019, 23:16

Re: xaml x:Name on UserControl results in compiler error

12 Aug 2021, 20:55

I have been made aware that this is not specific to Noesis : https://stackoverflow.com/questions/335 ... tion-error
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: xaml x:Name on UserControl results in compiler error

12 Aug 2021, 21:06

Was that answer from stackoverflow the source of your problem?
 
[email protected]
Topic Author
Posts: 19
Joined: 16 Jan 2019, 23:16

Re: xaml x:Name on UserControl results in compiler error

17 Aug 2021, 11:32

Was that answer from stackoverflow the source of your problem?
Kinda yes, I think my problem was that I had two folders with the same name in the path. I didn't exactly change the name of the folder to fix it, I completely changed path and that solved it.
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: xaml x:Name on UserControl results in compiler error

17 Aug 2021, 11:50

Ok, thanks for sharing the solution here.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 9 guests