15

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?

1
  • 2
    The only differene I know is MAUI specific conditional compilation Commented Oct 17, 2022 at 12:45

1 Answer 1

17

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I highly doubt that a regular class library now also has the platforms folder. What is more convenient is totally up to you and how you like to work with multi-targeting. Both ways end up with the exact same working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.