• 1
  • 2
  • 3
  • 4
  • 5
  • 14
 
User avatar
jsantos
Site Admin
Topic Author
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

26 Sep 2017, 21:19

I'm running into the exact same problem, this wasn't really an issue in the 2.1.0b3 but I now need to "reimport all" from the noesis settings, then reimport my folder with the XAMLs if I don't want to end up with a Noesis Access Violation crash. (It's a .NET 4.6 profile app)
As said in my previous post, could you try reproducing using our samples?

PD: We will address your second question later. thanks!
 
Gwynneth
Posts: 15
Joined: 20 Apr 2017, 18:31

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

27 Sep 2017, 00:16

Thanks for the beta! I've been testing 2.1.0b4 with Unity 2017.1.1f1. Everytime I relaunch Unity I need to reimport assets before I can run a scene. If I don't I get a NoesisException telling me the XAMLs could not be found. Furthermore, building the game also gives the same NoesisException. Is this still in the pipeline to be fixed or is this some new bug?
This is something new. Are you able to reproduce it with our samples? If affirmative, could you please describe the exact steps?

Whenever we change a XAML the corresponding Unity .asset is modified, but we leave to Unity the decision about when to save those changes to disk. So, if you close Unity abruptly (because you are debugging for example) your changes would be lost. Anyway, a clean installation of the Unity package should leave everything in correct state.

Could you please elaborate a bit about it?
The samples work fine. Building the game and running it also works. However, closing the game via Alt+F4 or via the close button crashes the game if the Development Build flag is used.

As for my own code: it doesn't matter when I close Unity. If I do the following:
1. Open Unity
2. Reimport all assets so Noesis doesn't throw an exception
3. Run the scene, look at my created UI and stop running.
4. Close Unity without changing anything both in the Unity editor as well as in the code editor.

Relaunching Unity and immediately running the scene will give the exception that the XAMLs cannot be found.

After some more testing the problem seems to be referenced XAMLs:
<UserControl x:Class="Assets.Views.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:views="clr-namespace:Assets.Views"
             DataContext="{Binding RelativeSource={RelativeSource Self}, Path=ViewModel}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>


        <Button Grid.Row="0" Content="{Binding ButtonContent}" Width="150" Margin="5"
                VerticalAlignment="Center" HorizontalAlignment="Center"
                Command="{Binding ToggleVisibilityCommand}"/>


        <views:SubView Grid.Row="1" Visibility="{Binding SubViewVisibility}"/>


        <Button Grid.Row="2" Content="Visibility Button" Width="150" Margin="5"
                VerticalAlignment="Center" HorizontalAlignment="Center"
                Visibility="{Binding SubViewVisibility}"
                Command="{Binding ExitCommand}"/>

    </Grid>
</UserControl>
Here, the SubView is a different XAML file. Does this information help?
 
pbastia
Posts: 14
Joined: 15 May 2017, 19:19

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

27 Sep 2017, 00:30

@Gwynneth I was facing a similar problem earlier. It turns out that Noesis doesn't always discover all the Xaml files if you are loading them dynamically at runtime. To avoid that issue, I added them in the NoesisSettings 'Preloaded Xamls' array, and everything worked well from that end.

@jsantos Thanks a lot for your reply! I am trying to put together a small project where the issue appears (I built this Caliburn Micro - style container view that would have a view model as a dependency property, and load the appropriate Xaml view for it, based on a naming convention. It's the dynamic loading of the xaml that crashes regularly). I'll be back as soon as I can on it, but it might take me a few days before I can get to that.
 
User avatar
jsantos
Site Admin
Topic Author
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

28 Sep 2017, 13:34

@Gwynneth I was facing a similar problem earlier. It turns out that Noesis doesn't always discover all the Xaml files if you are loading them dynamically at runtime. To avoid that issue, I added them in the NoesisSettings 'Preloaded Xamls' array, and everything worked well from that end.
Exactly, each UserControl xaml needs to be referenced from somewhere (this is Unity architecture, not us and it happens with all resources). We provide the 'Preloaded Xamls' array for that purpose, but you can use whatever solution suits you. The problem here is that sometimes (for example when you rebuild all the assets) the UserControl are already loaded by Unity and we are able to load it. We need to find a solution to improve the error message for these cases.
@jsantos Thanks a lot for your reply! I am trying to put together a small project where the issue appears (I built this Caliburn Micro - style container view that would have a view model as a dependency property, and load the appropriate Xaml view for it, based on a naming convention. It's the dynamic loading of the xaml that crashes regularly). I'll be back as soon as I can on it, but it might take me a few days before I can get to that.
Thanks! As soon as you have that small repro project with the crash, please send it to us. We will fix the crash ASAP.
 
Gwynneth
Posts: 15
Joined: 20 Apr 2017, 18:31

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

29 Sep 2017, 10:26

@jsantos, pbastia Thanks, everything works now!
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

29 Sep 2017, 11:02

@jsantos,
each UserControl xaml needs to be referenced from somewhere (this is Unity architecture, not us and it happens with all resources). We provide the 'Preloaded Xamls' array for that purpose, but you can use whatever solution suits you.
Seems to be a lot of hassle for Unity users with this as I've noticed.
From my experience, I almost never had XAML which was not used in the project, and when I had it was just a few files.
We still not updated our first game to NoesisGUI 2.x but if we had, it will be a lot of problems with it as there are hundreds of XAMLs and it's hard to determine which of them will break the game because they're not referenced via Unity system and loaded dynamically.
Why not make a mode when all XAML files in Unity project are automatically included in "Preloaded Xamls"? And use this mode by default.

Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
ivan_b
Posts: 100
Joined: 22 Jul 2015, 12:57

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

30 Sep 2017, 08:46

I have imported the new Noesis into Unity 5.6.0f3 and I have tried to run the Noesis samples but all of them display only a black screen.
In my project I have used Noesis 1.6 and after I have converted the project to the beta version of Noesis I got the error "Document contains no elements" for some xaml files.
Is there something in the settings that I am missing?
Thanks
 
nokola
Posts: 188
Joined: 10 Mar 2015, 05:29

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

01 Oct 2017, 19:19

I've fixed the "document contains no elements" by reimport all + unity restart. Does it work for you?
 
pbastia
Posts: 14
Joined: 15 May 2017, 19:19

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

02 Oct 2017, 18:39

Thanks! As soon as you have that small repro project with the crash, please send it to us. We will fix the crash ASAP.
I wasn't able to reproduce the issue on a smaller scale, this is strange. However, I keep on getting these 'Noesis Access Violation' crashes every so often. I attached a sample project with my current architecture, and a Unity crash report, maybe you could guide me towards finding out where the issue is? Is it possible that Noesis is actually not the cause of this?

Thanks a lot!

Sample project: https://drive.google.com/open?id=0B6SVH ... kdmRHNTVHc
Crash report:
crash_ee3d1c4eff7c1740a93eed8d06cbc0c6.zip
(62.26 KiB) Downloaded 214 times
 
ivan_b
Posts: 100
Joined: 22 Jul 2015, 12:57

Re: BETA: NoesisGUI v2.1.0b4 (Unity)

02 Oct 2017, 21:34

@nokola, thanks, it worked, but I still get the black screen.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 14

Who is online

Users browsing this forum: No registered users and 27 guests