skip to Main Content

UPDATE
After spending several days and dozens of hours on potential fixes, nothing works and I have given up on using Noesis. StackOverflow will not let me delete this as it has been "answered" but I assure you, I have tried these solutions and they do not work either.


I recently downloaded Unity and Visual Studio and are attempting to integrate the NoesisGUI framework into my project. It requires the System.Windows.RoutedEventArgs class, but the only class I can see in System.Windows is Input. I’ve googled around and it looks like RoutedEventArgs should be in the 4.8 .net framework and I’ve verified my Visual Studio .net version is 4.8.3928.0.

It is worth noting that in my References section of the Solutions tab, it has a hundred different System .dll references listed (including System.Windows), but not System.Windows.RoutedEventArgs.

Here’s some of the reference code, although I’ve removed anything that isn’t important.

using System;
using System.Windows.Controls;

namespace Dummy_Project
{
    public partial class Dummy_ProjectMainView : UserControl
    {
        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {

        }
    }
}

I tried downloading the .net 4.8 framework and installing that, but it was still missing. I also tried unloading the project multiple times as per these instructions, but the .vcxproj was not generated so it stopped there. I even uninstalled and reinstalled Visual Studio, but that didn’t change a thing.

I also found where PresentationCore.dll and moved it to the same folder as some of the other refences my project uses, rebuilt my project, but it still didn’t pick it up. I’ve tried to add it to the references list as per these instructions, but when I right click the "Add Project Reference" option doesn’t even show up

Any advice would be greatly appreciated.

2

Answers


  1. Noesis GUI does integrate with Unity where you can design user interfaces, controls externally either in Visual Studio or Microsoft Expression Blend. It appears your problem though is that you are trying to turn what is essentially a class library project (created by Unity) into something that will support NoesisGUI. There are easier ways to do that.

    The fix

    You should start off with something targeting NoesisGUI to begin with rather than change it after the fact.

    You should use the NoesisGUI Visual Studio project template available here.

    enter image description here

    …which will allow you to create a new Unity app utilising Noesis:

    enter image description here

    Designing in Visual Studio:

    enter image description here

    Seeing the results in Unity:

    enter image description here

    (images sourced from noesisengine, used without permission)

    See also

    Login or Signup to reply.
  2. Unity will add project references to its known libraries, or those that you manually add to the Plugins folder. But even then, the known libraries are often stubs, and the manually added plugins need to be compatible. Unlike standard VS project, it won’t pick up all of the libraries you have on your local machine.

    To illustrate the point, if you want to use System.Text.Json, you need to manually download that dll and all the dependancies, and add those to the Plugins folder. After that you will then have access to the System.Text.Json namespace. So, in some cases it can be done.

    Having said that, it’s an almost certainty you won’t be able to use anything relating to Windows ‘drawing’. That, and you may end up trying to include a spiderweb of dependencies trying to get it to work.

    For example, if I simply copy PresentationCore.dll (where the RoutedEventArgs class is defined) to my Plugins folder, I get this:
    enter image description here
    Which then needs the ‘System.Windows.Automation’ namespace, but I couldn’t see which dll that was defined in. But that’s my point.

    NOW, with in relation to NoesisGUI specifically… have you noticed that the project already contains a ‘proxy’ for RoutedEventArgs? There’s a file in "NoesisGUI/Plugins/API/Proxies" called RoutedEventArgs.cs.

    Edit: I made the assumption that you had used the asset from the Unity Asset Store here: https://assetstore.unity.com/packages/tools/gui/noesisgui-2-2-9282.
    It seems that there might be another NoesisGUI project, and that you might have been using that one instead?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search