Share via

will maui generate code for c# dlls imported?

Sojan 21 Reputation points
2022-08-29T00:08:53.843+00:00

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?

Thanks

Developer technologies | .NET | .NET Multi-platform App UI

Answer accepted by question author

Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,166 Reputation points Microsoft External Staff
2022-08-29T07:15:58.783+00:00

Hello,

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.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Sojan 21 Reputation points
    2022-09-02T02:40:06.927+00:00

    We can import dll into maui. it works.

    Was this answer helpful?

    0 comments No comments

  2. Sojan 21 Reputation points
    2022-08-29T23:29:01.303+00:00

    235897-screenshot-2022-08-30-112743.png
    The attached image of sourcecode is made using .net 2.0 , can we import this dll into maui

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.