DLL Files And .NET ClickOnce Deployment
I want to deploy one of my .NET apps as a ClickOnce application. The issue is that I am connecting to Oracle (see previous posts here and here). Connecting to Oracle requires at least, 4 DLL files that generally have to be in the same directory as the EXE file. The issue is that when the program is published, the DLLs are not referenced in any way, so the program won’t work.
Then I read about adding the files to the project, so that ClickOnce and the Publish processor will figure out that the DLLs are required and add them to the manifest.
Here is the process in Visual Studio 2005:
1. Put the 4 DLL files in their own directory in your solution directory (for ease of use mostly).
2. Add all four files to your project by going to “Project->Add Existing Item…”
3. Click on each DLL file in the solution explorer and then change their property: “Copy To Output Directory” to “Copy Always”.
That’s it! Now when I publish or even run the application I don’t have to worry about if the DLL files are where they should be.
Tags: "copy always", .net, clickonce, deploy, dll, oracle, tip

May 22nd, 2008 at 7:29 am
Hey i got the same problem.
I have to include some crystal reports dll’s.
Now the dll’s are set to copy always. But when i publisch and install there are no crystal reports with the setup from clickonce installed on client.
Did you get it to work ?
Kris
June 19th, 2008 at 9:21 pm
I have not tried doing that with a program that installs on the client, but I assume it should still include the DLLs in the manifest.
For installing, you might need to check out the options in the project properties. There may be another method to use for installed programs.
June 20th, 2008 at 2:58 am
I got it to work.
ClickOnce only deploy (take) the dll files that are needed to run the program.
What i did:
- for each file in solution(in my case only the reports) select the properties of each file and set the build action to embedded recource.
- Build in release mode
- Run the click once again.
and it worked.
I missed the reports in the solution and that was the cause of the problem.
Thanks for the information.
regards
Kris Nobels
August 23rd, 2008 at 10:59 pm
[...] « C# .NET Programming Tip: Types DLL Files And .NET ClickOnce Deployment [...]
August 28th, 2008 at 1:03 am
I want to include oracle dll with Apllication file while doing click once deployement
Apllication file shows all the dlls except oracle dll.what i have to do.
Please clarify this prob.
August 28th, 2008 at 7:21 am
>I want to include oracle dll with Apllication file while doing click once deployement
>Apllication file shows all the dlls except oracle dll.what i have to do.
>Please clarify this prob.
When you add the file to the project and set the build action to “Content” and the copy to output directory “Copy always,” this should add the dll files to the manifest for clickonce…
you can check this by going to your project properties in the main menu, then selecting the publish tab. From there click on the “Application Files…,” which will show you a list of all files to be included. The dll files from before should be in that list.
January 2nd, 2009 at 10:35 am
do you know how to make ClickOnce application run on Opera? Thanks
January 2nd, 2009 at 5:36 pm
While I don’t think it is impossible, chances are it would require some type of plugin/hack to get 3rd party browsers to run ClickOnce apps.
Here is some information I came across with a quick Google search on the subject:
http://channel9.msdn.com/forums/Coffeehouse/134875-ClickOnce-and-alternative-browsers/
January 9th, 2009 at 2:17 pm
Which are the four required dlls? I included oracle.dataacess.dll. I am getting “oracle.dataaccess type initializer… threw an exception” when executing my oracle client application deployed using ClickOnce. The oracle.dataacess.dll is copied to the same directory as the .exe
thanks Annie
January 9th, 2009 at 4:08 pm
My other article stated which DLLs are used.
We need these four:
oci.dll
orannzsbb10.dll
oraocci10.dll
oraociicus10.dll
January 12th, 2009 at 9:27 am
Thanks Scott!
February 25th, 2009 at 11:03 am
Thanks for the information. These three articles have been very helpful!!!
-cb
June 1st, 2009 at 12:17 pm
Scott’s dead on… you need those 4 dlls from the Instant Client software, and the OraOps dll for your version from the ODP.Net package…
they should be included as Content, and Copy Local… the manifest deploys them properly that way, and since they are in the root application folder they need nothing else… no registry, no path entry, no gac deployment, and do not need elevated permissions to reach.
works beautiful. thanks scott.
to confirm – i am using the 11.1.0.6 Instant Client and I pulled the necessary ODP files out of the XCopy distribution of ODAC 11.1.0.6.
August 12th, 2009 at 12:50 am
Good post,This was exactly what I needed to read today! I am sure this has relevance to many of us out there.