How to implement "When the maui project is executed and compiled to generate an EXE, how to place all the dependent dll files of the EXE in the libs directory under the EXE directory"

晅晢 廖 0 Reputation points
2024-04-16T07:51:34.15+00:00

I am a beginner of MAUI. I developed a simple Windows project using maui.

I now encounter a problem. The problem is that the compilation result of this project will copy all the dependent DLLs of the EXE to the same directory of the EXE.

These DLLs include basic DLLs of .net7 such as [System.Text.Json.dll], etc. Since the number of DLLs reaches more than 400, the execution directory is very confusing.

That's why I wrote today to ask how to "When the maui project is executed and compiled to generate an EXE, how to place all the dependent dll files of the EXE in the libs directory under the EXE directory"

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,889 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,268 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,576 Reputation points Microsoft Vendor
    2024-04-17T02:32:09.0133333+00:00

    Hello,

    I now encounter a problem. The problem is that the compilation result of this project will copy all the dependent DLLs of the EXE to the same directory of the EXE.

    This is decided by VS. For debugging during compilation, VS will place all dependent files in the project folder.

    That's why I wrote today to ask how to "When the maui project is executed and compiled to generate an EXE, how to place all the dependent dll files of the EXE in the libs directory under the EXE directory"

    For packaging and publishing MAUI applications on Windows, you can refer to this official document to package and publish them as msix files.

    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