error CS0246: The type or namespace name 'Window' could not be found
Posted: 05 Dec 2023, 21:45
Full error: error CS0246: The type or namespace name 'Window' could not be found (are you missing a using directive or an assembly reference?)
This issue was briefly touched in Noesis forum post viewtopic.php?p=11899&hilit=CS0246#p11899, but there was no solution provided.
I need to use a WPF Window with Noesis and Unity; a UserControl won't work in my current scenario. Is this a known issue? Is there a workaround?
There is no parser error in Visual Studio 2019. The error only comes up in Unity 2022.3.4f1. I do not know if this issue is resolved in later versions of either Visual Studio or Unity; I'm restricted to those versions. We're also using Noesis.GUI.Extensions 3.0.24.
Thank you for your time and assistance!
This issue was briefly touched in Noesis forum post viewtopic.php?p=11899&hilit=CS0246#p11899, but there was no solution provided.
I need to use a WPF Window with Noesis and Unity; a UserControl won't work in my current scenario. Is this a known issue? Is there a workaround?
There is no parser error in Visual Studio 2019. The error only comes up in Unity 2022.3.4f1. I do not know if this issue is resolved in later versions of either Visual Studio or Unity; I'm restricted to those versions. We're also using Noesis.GUI.Extensions 3.0.24.
Thank you for your time and assistance!
Code: Select all
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
#else
using System.Windows;
#endif
namespace WPFApp1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
#if NOESIS
private void InitializeComponent()
{
NoesisUnity.LoadComponent(this);
}
#endif
}
}