Automatically adding dll file to publish without reference
-
Hi, I'm working on a C# project in which there's a conflict between two dll-files (office automation dll's, version 2.1 & version 2.4), forcing me to manually copy the second dll to the "bin/Debug" folder instead of referencing to it in the solution. The problem is that the project needs to be distributed using the ClickOnce publish feature in Visual Studio 2005, and the second dll is not added to the distributed version of the project. Now I need this file to be included into the publish procedure, so it is added in the result and can be used. I have been exploring VS 2005, but I didn't find any solution up till now. Is there a way to auto-include non-referenced dll files to a publish, or will I need to solve the dll conflict in another way? Both dll files have a different name and the project runs as it should, but the "old" dll file does not completely support the features we are using. And upgrading the old functionality to the new Office dll is also not an option :-(. Any help is appreciated! ;-) Greetz
-
Hi, I'm working on a C# project in which there's a conflict between two dll-files (office automation dll's, version 2.1 & version 2.4), forcing me to manually copy the second dll to the "bin/Debug" folder instead of referencing to it in the solution. The problem is that the project needs to be distributed using the ClickOnce publish feature in Visual Studio 2005, and the second dll is not added to the distributed version of the project. Now I need this file to be included into the publish procedure, so it is added in the result and can be used. I have been exploring VS 2005, but I didn't find any solution up till now. Is there a way to auto-include non-referenced dll files to a publish, or will I need to solve the dll conflict in another way? Both dll files have a different name and the project runs as it should, but the "old" dll file does not completely support the features we are using. And upgrading the old functionality to the new Office dll is also not an option :-(. Any help is appreciated! ;-) Greetz
If I understand you correctly this should solve your problem: 1. Copy non-referenced dll to your project's directory and add it to project using Add -> Existing Item -> browse to dll. 2. When it is added to project, right click in it on Solution Explorer -> Properties and Set Build Action -> Content (ClickOnce problem) && Copty to Output Directory -> Copy Always (autocopy) in Properties Window 3. If you now right click on your project icon in Solution Explorer -> go to project Properties -> Publish -> Application Files, you should see your dll in list with status Include(Auto). Hope this solves your problem, if not -> give more details and I'll answer :). Cheers!
-
If I understand you correctly this should solve your problem: 1. Copy non-referenced dll to your project's directory and add it to project using Add -> Existing Item -> browse to dll. 2. When it is added to project, right click in it on Solution Explorer -> Properties and Set Build Action -> Content (ClickOnce problem) && Copty to Output Directory -> Copy Always (autocopy) in Properties Window 3. If you now right click on your project icon in Solution Explorer -> go to project Properties -> Publish -> Application Files, you should see your dll in list with status Include(Auto). Hope this solves your problem, if not -> give more details and I'll answer :). Cheers!
I tried your solution, but when debugging, the second dll file (office 2007 dll) is not copied to the Debug folder, only the first one (office 2000 dll) is copied. If I remove the reference to the first dll than the second one is copied. So it seems that only one of the dlls can be in the compiled result. I assume Visual Studio detects an Assembly name or something and this name is the same in both dll files. I managed to get both dll files in there by adding them both manually and setting build action to "None" and Copy to Output Directory to "Copy Always". The problem is that when debugging, the program crashes with an error that the second dll file could not be found. :sigh: I'm out of options at the moment. Hope you can help me.