79343450

Date: 2025-01-09 17:04:52
Score: 0.5
Natty:
Report link

In the .csproj file of your WinUI 3 application, add:

<PropertyGroup>
   <PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>

Open your project in VS 2022 and right click project in solution explorer: Properties > Build > Publish > Uncheck Publish trimmed.


The trimming optimization feature of VS 2022 (which only runs in release mode) trims necessary methods in the MongoDB.Driver dll file which causes the connection to the database to fail.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Alpha Reuel