Packaging Oracle Data Access Components into .Net projects

We don’t want to have every user install Oracle Data Access Components and drivers so we want to package it into our deployment.

first dowload Oracle Data Access Components. The most current one as of 2/11/2011 is

http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

note that this is the 32 bit version. This is because if you get the 64 bit version but you are targeting 32 bit (x86 platform) you will get a warning at compile time.

after downloading and installing ODAC.
find the following files

oci.dll
ociw32.dll
Oracle.DataAccess.dll
orannzsbb11.dll
oraocci11.dll
oraociicus11.dll
OraOps11w.dll

If you are using Oracle.DataAccess.dll in your project you will want to add it to your project as a reference.

Next we need to create a new project for the deployment. Other Project Types > Setup and Deployment > Visual Studio Installer > Setup Project.

Right click on the setup project and Add > Project Output…
Add your projects output in here.
Now we add rest of the dependencies that oracle needs. Right click on the setup project and Add > File …
Add the rest of the dlls in the list:
oci.dll
ociw32.dll
orannzsbb11.dll
oraocci11.dll
oraociicus11.dll
OraOps11w.dll
Oracle.DataAccess.dll — don’t need this one because it should be in the references already.

Build the project and you are ready to deploy it.

if you get “The provider is not compatible with the version of Oracle client”
make sure you are getting all the dlls from a single install of ODAC

This should add roughly 38 megs to your project.

msvcr71.dll too?

http://stackoverflow.com/questions/923283/what-is-the-minimal-setup-required-to-deploy-a-net-application-with-oracle-clie
posted @ 2012-02-19 14:07  东风125  阅读(802)  评论(0编辑  收藏  举报