Is there any way to reduce DLL clutter in my ClickOnce app?
My problem is that DLLs needed by my ClickOnce app are cluttering my project folder and I would like to move them to a bin folder but don't know a simple way to do so and still get the files to distribute.
To explain:
I'm distributing a C# app with ClickOnce. It has the follow开发者_运维问答ing components:
- One C# application
- One CLR DLL
- Umpteen C++ DLLs
All of these build to a tidy little bin folder.
Now the CLR DLL is referenced from the C# project, so it copies and deploys fine.
But I also want to distribute the C++ DLLs as part of the ClickOnce project, so I've done the thing that people say to do, which is add them to the C# project (drag ... drop), and in Properties, set Build Action to Content and Copy to Output Directory to Copy if Newer.
ClickOnce seems to deploy these files quite nicely.
The problem, though, is that now I have a bunch of binaries dumped into my C# project folder (and appearing in the project root in the IDE), which mixes executable files with source files in a way that is extremely obnoxious.
Can anyone clue me in to a simple way to keep all my DLLs in the output folder where they belong, and also have them distributed by ClickOnce?
Move you C++ DLLs somewhere sensible then when you add them to the project choose to add them as a Link instead of the standard Add which copies the files to the project folder.
To do this follow these steps:
- Right click the project file and choose add existing file.
- Navigate to the location of the file(s).
- Click the down arrow next to the Add button and select Add as Link
精彩评论