.NET MAUI

88 readers
1 users here now

founded 1 year ago
MODERATORS
26
27
28
29
30
31
 
 

😂Shared with permission from the author

32
33
 
 

cross-posted from: https://programming.dev/post/10535103

Microsoft DevBlogs has just been federated and can be followed at @msftdevblogs@dotnet.social.

Thanks to @mapache@hachyderm.io!

34
1
submitted 9 months ago* (last edited 9 months ago) by SmartmanApps@programming.dev to c/dotnetmaui@programming.dev
 
 

Hello everyone. I just ran into an issue upgrading to MAUI 8.0.6 and thought I'd warn you to save some hair-pulling. Note that you can create a new MAUI app as 8.0.6 and it'll work - the issue only applies to if you have an existing <=8.03 app and try to upgrade.

As per my previous post, I ran into another issue with 8.0.6 (first time MAUI has gone the upgrade via nuget path - what could go wrong?!), and eventually I realised I already had a repo I could use for repro (I couldn't use the app I was working on), and all I would have to do was update it to 8.06 and... I couldn't (sigh).

If this comment is correct then it relates to Essentials. I tried their work-around but it didn't work for me.

So my status now is I need them to fix this, so I can repro the other issue in 8.0.6, so that they can fix that too and Flyout works again - I'm currently considering downgrading to .NET 7.0 until they get their act together with 8.0.

35
 
 

In MAUI 8.03 we had the Flyout bug where the NavigationPage Title wouldn't update from the first page you had been on. In MAUI 8.06 that bug has been fixed but has introduced a new one on Windows (sigh).

Starting on Page1 I can use the Flyout to switch to Page2. Then, on Windows, if I use Flyout to switch back to already-existing Page1 it crashes with...

System.Runtime.InteropServices.COMException (0x800F1000): No installed components were detected.

Element is already the child of another element

It works on Android, and it works if you are creating a new page each time, it just doesn't work on Windows to switch back to an already-created page (which defeats the whole purpose of having a Flyout menu - switch between 2 pages without making a new one every time).

  1. Does anyone know of a workaround to this? I can't find anything that relates to this in the context of a MAUI Flyout.
  2. Does anyone have a real simple Flyout template that could be used for the repro (to put in the issue I'm gonna need to create). The one I'm working on has a whole bunch of my own libraries in it, so I'm gonna need to tear them all out before I can use it to make a repro (and of course they don't provide a template, and their sample doesn't work due to different bugs - sigh).
36
 
 

I've just run into a MAUI issue which is specific to Windows (works fine on Android), and so I looked for a Windows Lemmy Community and was surprised to find there wasn't one! So I have created one at !windows_dev@programming.dev

Of course you are still welcome to post about MAUI issues in !dotnetmaui@programming.dev but if the issue is specific to Windows (as I have just encountered) then there is now the Windows Development Community as well (and of course we already have Communities for Android and IOS development, for issues on those platforms).

37
 
 

I've just had this happen (and then stop again) for the second time in a few weeks. This is a new MAUI app where the only thing I've changed so far, other than add a few of my own (already previously tested and working) libraries, is change the home page, and the new home page only has a couple of labels on it, so it has no complexity at all added to it yet, and yet getting this odd alleged memory issue. The first time it happened I couldn't find a fix for it, left it for a while, came back (a week's worth of reboots later) and it was working again. Then today I made one trivial change - added a debug write - and the problem came back (but got past the new line without any issues). Then I rebooted and it's working again.

I have 32Gb of RAM, with 12Gb allocated to a RAMdisk, and I have my paging files set to use the RAMdisk.

It generated a log file which said...

"Native memory allocation (mmap) failed to map 186646528 bytes for G1 virtual space"

...so it only needed 180Mb, and down near the bottom it says...

"Memory: 4k page, system-wide physical 32579M (3638M free)"

...so I had more than enough space left (so the memory message may be a red herring for whatever did cause the crash). Googling that first message brings up a bunch of matches, but none of which are for MAUI Android (all different cases with different fixes).

This is using the Android emulator on a Windows machine where I've set the paging sizes to be system-managed. I'm not sure where the Android emulator actually gets memory from though - the system RAM? The paging RAM(disk)? The build directory? The user's App directory?

It reminds me of years ago there was a similar issue with Xamarin Android where the fix/workaround was to add a line to the csproj (I think it increased the heap or something from memory), but I haven't seen that pop up in a long time. Not sure if this is the same issue or a different one.

There's no repro for it cos I can't even reliably repro it. I'm just concerned that it's going to keep coming back given I haven't even added any complexity to it yet.

Has anyone run into this and/or knows how to fix it?

38
 
 

Marco Siccardi has shared an extensive post about MAUI menus (came up in my Mastodon feed, but lacked some relevant tags, so mostly only his followers would've seen it) that I thought some of you might find helpful. I wanted to share it here so that it's easier to find again later - Marco's post about MAUI menus

39
 
 

Test post (inbound bot working?)
@dotnetmaui
Testing if inbound works (outbound doesn't)

40
 
 

I'm just trying out the built-in builder.Logging.AddDebug(); in a MAUI app, but don't see the output anywhere. From several blogs I expected to see the messages in the Visual Studio Debug output window, but they aren't appearing.

Just using the stock-standard MAUI app, the only changes I have made are in App.cs as follows...

using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls;
namespace BaseMAUIApp;
internal class App :Application
{
public App(ILogger<App> logger) {
    logger.LogDebug("******************* Message from logger!");
// rest of code...

But I don't see my message anywhere. Is there something else I have to configure, or somewhere else I have to look?

41
42
43
 
 

MAUI dev experience on Windows 11 vs. Windows 10
@dotnetmaui
I'm taking delivery of a new dev machine in the next day or two, and the new one is Windows 11 compatible, so I have the option there to install Win11, but I also have the option of sticking with Win10 for a while. The only thing that really stands out to me with 11 is WSL, which is "nice but not necessary".

For those #dotNetMAUI devs who have developed on both, have you found Win11 to be better? Worse? About the same?
#dotNet

44
 
 

I had cause to mention this to someone today, and thought I would share this here for anyone who may not have seen it before and would be interested in this info - Creating MAUI UI's in C#

45
 
 

Original post from Mastodon test
@dotnetmaui
If you see this it worked! 😃

46
47
 
 

Hello everyone. I am your mod, Donald, Founder of Smartman Apps. You can find me on Mastodon at @SmartmanApps@dotnet.social.

You can follow/post to this Community from Mastodon by following @dotnetmaui@programming.dev

A few rules...

  1. As usual these site-wide rules apply (bear in mind this is a SFW Community)...
  • Dangerous content on the instance and federated instances including phishing, spamming, brigading, unmarked nsfw, nsfw content in sfw communities, doxing, etc. is not allowed and subject to be handled by the mods or admins
  • Hate speech is not allowed on the instance or in instances federated with it. This includes remarks directed at sex, gender, ethnicity, orientation, disabilities, etc…
  1. It is strongly recommended to cross-post to the dotnet Community here.
  2. Anything that is related to developing with MAUI is welcome. e.g. MAUI controls, bugs, platform-specific issues (such as MAUI on Android), upgrading from Xamarin, XAML, as well as dotnet and csharp (though consider posting there for that, or perhaps cross-post).
  3. When posting, bear in mind that these are also going out to people's Mastodon feeds. i.e. try not to be overly wordy.
  4. I reserve the right to modify these rules :-) (but also feel free to make appropriate suggestions for such modifications).

P.S. I used mod-dotnet-bot.net to make the icon for this Community, if anyone was wondering

48