NoesisException: Xaml not found in the built exe, running fine in play mode
Hello,
As said in the title, I'm encountering a weird behavior, and I can't tell if my lack of understanding is to blame :p
I've created two UserControl, one being named Home, another being named HomeNavigation. Both contain absolutely nothing complicated. Basically, Home is hosting HomeNavigation, and HomeNavigation contains text. The following is running fine in Unity Editor in play mode.
Home.xaml :
Home.xaml.cs :
HomeNavigation.xaml :
HomeNavigation.xaml.cs :
Once I build this and launch the exe, nothing is rendered, the error described in the output log is pretty clear : "NoesisException: Xaml not found 'Assets/Ism/View/HomeNavigation.xaml'". Except this is the actual location for this file... 
Some help would be welcome, I'm using Unity 5.6.1p2 (64-bit) and my OS is Windows 10.
As said in the title, I'm encountering a weird behavior, and I can't tell if my lack of understanding is to blame :p
I've created two UserControl, one being named Home, another being named HomeNavigation. Both contain absolutely nothing complicated. Basically, Home is hosting HomeNavigation, and HomeNavigation contains text. The following is running fine in Unity Editor in play mode.
Home.xaml :
Code: Select all
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:ism="clr-namespace:Ism.View"
x:Class="Ism.View.Home"
d:DesignWidth="1920" d:DesignHeight="1080">
<Grid x:Name="HomeLayout">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"/>
<ColumnDefinition Width="1420"/>
</Grid.ColumnDefinitions>
<ism:HomeNavigation Grid.Column="0" Grid.Row="0" />
<Grid x:Name="HomeFeed" Grid.Column="1" Grid.Row="0">
</Grid>
</Grid>
</UserControl>
Code: Select all
using Noesis;
namespace Ism.View
{
public partial class Home : UserControl
{
public Home()
{
Initialized += Home_Initialized;
InitializeComponent();
}
private void InitializeComponent()
{
GUI.LoadComponent(this, "Assets/Ism/View/Home.xaml");
}
private void Home_Initialized(object sender, EventArgs e)
{
}
}
}
Code: Select all
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:ism="clr-namespace:Ism.View"
x:Class="Ism.View.HomeNavigation"
d:DesignWidth="1920" d:DesignHeight="1080">
<Grid>
<TextBlock>Text</TextBlock>
</Grid>
</UserControl>
Code: Select all
using Noesis;
namespace Ism.View
{
public partial class HomeNavigation : UserControl
{
public HomeNavigation()
{
Initialized += HomeNavigation_Initialized;
InitializeComponent();
}
private void InitializeComponent()
{
GUI.LoadComponent(this, "Assets/Ism/View/HomeNavigation.xaml");
}
private void HomeNavigation_Initialized(object sender, EventArgs e)
{
}
}
}

Some help would be welcome, I'm using Unity 5.6.1p2 (64-bit) and my OS is Windows 10.
Re: NoesisException: Xaml not found in the built exe, running fine in play mode
You can fix this by applying the solution described in the Unity tutorial. UserControls enter the category of XAML loaded by code because for each user control your are loading the corresponding XAML manually. We should probably clarify this in the documentation.
Code: Select all
private void InitializeComponent()
{
GUI.LoadComponent(this, "Assets/Ism/View/Home.xaml");
}
Re: NoesisException: Xaml not found in the built exe, running fine in play mode
Thanks. I preloaded them through NoesisSettings 

Re: NoesisException: Xaml not found in the built exe, running fine in play mode
Marking as solved. Thanks for the feedback!
Who is online
Users browsing this forum: Roms6, Semrush [Bot] and 1 guest