Deploying WPF Application with 3rd Party DLLs

后端 未结 6 1044
失恋的感觉
失恋的感觉 2020-12-03 05:37

I\'ve been extremely frustrated trying to deploy a C#/WPF application I\'ve created that has some references to 3rd party DLLs. I created a folder in the project, called

6条回答
  •  误落风尘
    2020-12-03 06:09

    Read very carefully the official list of CefSharp dependencies - there are a lot of them! You need to get them all into the ClickOnce bin folder somehow.

    Here is how I solved it:

    • Before deploying, install the latest version of Visual C++ Redistributable. on each PC you are deploying to (using group policy or just manually).
    • Start with a blank test project.
    • Add project references to CefSharp, CefSharp.Core, etc.
    • Add each dependency into a single folder in the project directory to keep them organised (Files\CefSharp\).
    • Ensure all files are configured with Build Action: Content, and Copy to Output Dir: Copy always.
    • Make a function Initalise_CefSharpFiles() to copy the files/folders into the bin root folder (where CefSharp looks for them). For example, copy from: Bin\Files\CefSharp\* to: Bin\*.
    • And finally at run time, call Initalise_CefSharpFiles() once after the app loads, and before initialising CefSharp's settings.

提交回复
热议问题