will maui generate code for c# dlls imported?

Sojan 21 Reputation points

From my understanding, we can't import dll into maui as it is already complied. or can we?

will it automatically generate the versions of android, ios and windows for the code in the dll?


A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,812 questions
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 34,226 Reputation points Microsoft Vendor


    You can import dll into MAUI project, for instance, you could import MAUI class library into your MAUI project.

    will it automatically generate the versions of android, ios and windows for the code in the dll?

    For a MAUI class library project, it will automatically generate the dll files as the following building log said:

       1>MauiLib1 -> C:\Users\username\source\repos\MauiLib1\MauiLib1\bin\Debug\net6.0-maccatalyst\MauiLib1.dll   
       1>MauiLib1 -> C:\Users\username\source\repos\MauiLib1\MauiLib1\bin\Debug\net6.0\MauiLib1.dll  
       1>MauiLib1 -> C:\Users\username\source\repos\MauiLib1\MauiLib1\bin\Debug\net6.0-ios\MauiLib1.dll  
       1>MauiLib1 -> C:\Users\username\source\repos\MauiLib1\MauiLib1\bin\Debug\net6.0-windows10.0.19041.0\MauiLib1.dll  
       1>MauiLib1 -> C:\Users\username\source\repos\MauiLib1\MauiLib1\bin\Debug\net6.0-android\MauiLib1.dll  

    Best Regards,

    Alec Liu.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Sojan 21 Reputation points

    The attached image of sourcecode is made using .net 2.0 , can we import this dll into maui

    0 comments No comments

  2. Sojan 21 Reputation points

    We can import dll into maui. it works.

    0 comments No comments