ebswifty
Posts: 26
Joined: Mon Jul 16, 2012 10:35 pm

.Net Core Avalonia UI Frozen

Tue Sep 10, 2019 5:32 am

I have tried this two different ways, firstly starting here:

https://www.youtube.com/watch?v=rho26Ik30D4

And ending up here:

https://avaloniaui.net/docs/tutorial/

I am building this using .Net Core 2.2.6 (2.2.401 SDK), VS Community 2019. I tried with the .Net Core installed on the Raspberry Pi and also with publishing as a self-contained project. The application runs but the interface is unresponsive. In both examples above I can't interact with the on-screen controls, they are completely non-responsive. In the case of the hello world example I setup console output as well as SerilogLogger, the program starts up and there are no errors reported, console does output so the application does start up. If I minimise the app then restore it, the app interface is garbled - as in the window transition is repeated all across itself. If I then maximise it returns to normal, likewise when it is restored again.

I first tried on Raspbian Stretch, the controls did not render correctly, they just rendered squashed, text didn't render at all and it is unresponsive to any clicks. On Buster, it renders nicely and like Stretch is unresponsive to user interaction. Both applications run just fine in the Windows build environment. At one point I even published the project from source on the Raspi using an installed SDK and that did not make any difference from the Windows published application. Between tests of having the Core runtime/SDK installed/not installed I have been re-writing a completely fresh Raspbian image, currently concentrating on Buster since it at least displays the UI.

Since everyone else has this working I must be doing something pretty fundamentally wrong, any ideas??


dobova86
Posts: 71
Joined: Wed Dec 05, 2012 5:32 pm

Re: .Net Core Avalonia UI Frozen

Mon Sep 23, 2019 8:51 am

I'm testing if Avalonia can solve some UI need on Raspberry Buster. I'using nightly build, but AppBuilder created object "app" has no app.Run() method anymore ... I'm for sure missing some reference but I can't figure out ... I'm using vs2019 (not preview).

ebswifty
Posts: 26
Joined: Mon Jul 16, 2012 10:35 pm

Re: .Net Core Avalonia UI Frozen

Mon Sep 23, 2019 10:22 am

My approach is somewhat simplified now, I haven't run into the issue you're describing, App.Run was generated in Program.cs - EDIT, I created an MVVM project so I don't know if that was the key. I'm also using Avalonia nightlies but have moved to .Net Core 3.0 preview along with VS 2019 preview (because I wanted to access SerialPort - I did have to add System.IO.Ports manually in Nuget though). So now I can develop, run and debug in Visual Studio on Windows, then simply publish targeting Arm. I copy that folder to the Raspberry Pi, chmod +x on the application filename and I can just run it without having to install anything or prep Buster at all. It didn't want to run on Stretch, the UI didn't display at all so I just run with Buster now and all is well. The only thing missing in development is the xaml preview which Microsoft says is being worked on for a future release.

I've developed a Shearmatic DAQ using the Raspberry Pi along with the official touchscreen and in testing it has run for about 4 days non-stop without issue. I push all the data out to a Google Sheet which displays a live graph of the data so it can be displayed or monitored from anywhere.

Something off-topic I noticed is that the Raspberry Pi B+ glitches the serial port, I did notice some issues where the Shearmatic would mysteriously not send any data. I stumbled across the same problem where the computer pushing out dummy data from another c# app over serial would also stop sending any data after resetting the Raspberry Pi until I pulled the plug on the USB->serial on the PC and re-plugged it in. The other thing I found was some kind of interference was glitching load data coming from the Shearmatic, numbers would jump around just a bit while the Raspberry Pi was connected to the serial cable. I solved all this by installing an isolated USB to serial (which is expensive) and this fixed all the issues.

dobova86
Posts: 71
Joined: Wed Dec 05, 2012 5:32 pm

Re: .Net Core Avalonia UI Frozen

Mon Sep 23, 2019 1:26 pm

I figure out the problem and now compile and run on Buster (I missed a using directive) (net core 3.0 rc1).
This is a mess anyway becouse nightly build seems NOT to run on Stretch, and MessageBox class is not working anymore. So I will wait next release and check again. I need a runnable program for stretch and for buster. On the other hand I can't use net core on buster becouse sqlclient doesn't work and httpclient with https not working correctly.
Not usable right now :(

Return to “Other programming languages”