Reputation: 4485
In a WPF application ProjectWPF
that references another project ProjectB
, ProjectB output is a single DLL (a plug in) that I must include in a folder called 'PlugIns' in the root of 'ProjectWPF'.
Now I found a way to include the file, using Add as Link
feature. What I did was created a folder called PlugIns in the ProjectWPF project. Then I Add Existing Items... and browse to the folder in ProjectB that contains the DLL - in this case bin/Debug version. Then set the properties of the linked file to Content and Copy Always.
When I build the project, everything works, the bin Debug and bin Release folders of the ProjectWPF project contain my PlugIns folder and that folder contains the DLL.
When I publish the ProjectWPF using ClickOnce, and then install it by running Setup.exe and browse the application directory I can see the folder PlugIns
with the DLL inside. So Add as Link feature does work.
However this plug in DLL is only a copy of the Debug version. Even if I switch to Release in ProjectWPF, it was always grab the Debug version I originally linked to. What I want is for it to grab the appropriate version for the build mode I'm in (Release version or Debug version)
Is there a better way to manage this between Debug and Release versions? Or is there a better approach to embedding external dependencies (like plug ins) in a ClickOnce application?
P.S. this is .NET 4.5 or later
Upvotes: 1
Views: 458
Reputation: 4892
You don't need to add the reference, even as a link for the deployment to work. After you generate the manifest open it with Manifest Manager Utility. Then follow this steps:
You can take a look here . Although this documentation point to WPF Prism application, it is valid for any manifest, WPF or Winform, generated with ClickOnce.
Upvotes: 1