Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between a MAUI class library and a normal class library?

As far as I can tell a MAUI Class Library is a class library in .NET 6, where you can inject platform specific code. But is there really any other difference between a MAUI library and a .NET 6 library? Are they interchangeable if you leave out the platform code?

like image 382
GottaLovePizzas Avatar asked Jan 27 '26 23:01

GottaLovePizzas


1 Answers

The only difference is that it has the multi-targeting already built-in. Meaning that the .NET MAUI class library will already have a Platforms folder with the different platforms inside of that and you can put your platform specific code in there.

That is also described here: https://learn.microsoft.com/dotnet/maui/platform-integration/configure-multi-targeting

If you're really sure you don't need any platform specifics you can also use a regular class library. If you do run into something that requires you to use platform-specific code or you want to have more control over the naming conventions etc. You can still follow the documentation that is linked above.

like image 93
Gerald Versluis Avatar answered Jan 29 '26 11:01

Gerald Versluis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!