Replies: 1 comment 7 replies
-
There should be nothing special. What this means is, basically, first check whether or not you need the debug version of the VC runtime. If you don't then you could just get away with just using the release version. If your application is unpackaged, then just install the Visual C++ 2015-2022 redistributable that matches your application's architecture onto the target machine along with your application. If it is packaged, then just edit the project's Package.appxmanifest file, find the section that reads:
and just add:
to it. The entire section should be:
This will reference the latest Visual C++ 2015-2022 redistributable that was packaged up. Hopefully this is good enough to get things going. If the library does require the debug runtime for debug builds, then things get problematic. The debug runtime isn't seen as redistributable and you would likely need the debug UCRT too. But we'll deal with that if needed. |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm working on a WinUI 3 packaged app. There are a couple of 3rd-party dll's that I'd like to reference from my app. These dll's were written in C++, and depend on the Microsoft Visual C++ 2015 Redistributables (specifically, the 64-bit (x64) 14.0.24215 version). Here's what I'm finding:
If I reference these dll's from a WinUI 3 application, the application builds and runs. However, when I try to navigate to a button handler that calls code in the dll's, my app crashes with an exception. The exception reads as follows:
Could not load file or assembly 'C:\Projects\LucidDotNet\Main\bin\x64\Debug\net8.0-windows10.0.19041.0\win-x64\AppX\ArenaNET_v142.dll'. The specified module could not be found.
The dll in question is, in fact, present in the directory listed in the above exception message. However, I was wondering if the dll is failing to load due to its dependency on the VC++ runtimes.
I can reference and use these dll's with no issues from something like a .NET 8 WPF application; it's only in a WinUI 3 app that it does not work.
By the way, the method I used to reference the dll's was to right-click on my project's "Dependencies" and add them as file references. They then show up under the "Assemblies" section of the Dependencies. I also tried setting their "Copy Local" properties to "Yes," but that made no difference.
So my question is: Is there something special you have to do in order to package such dll's in a WinUI 3 application that is not necessary to do on a WPF application?
Beta Was this translation helpful? Give feedback.
All reactions