1

I have a .NET solution which contains multiple projects. All the projects which refer the Oracle.DataAccess.dll have set Copy Local = false for it. When I build the solution in Debug mode, the dll does not get copied to bin\Debug folder but in Release mode, it does get copied to bin\Release folder.

I am maintaining 64-bit and 32-bit dlls in bin64 and bin32 folder and resolving at runtime for these and it is working fine in Debug mode. But in Release mode when application runs, I am getting exception that says Could not load file or assembly 'Oracle.DataAccess.dll', .....

Why is the dll getting copied to bin\Release folder ?

After changing the Verbosity of MSBuild in Output Window, I found:

Copying file from "C:\app\brij\product\11.1.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll" to "bin\Release\Oracle.DataAccess.dll"

Brij
  • 11,731
  • 22
  • 78
  • 116
  • Actually, the ending of this would be even more interesting: `"Could not load file or assembly 'Oracle.DataAccess.dll...."` <-- what is here? – T.S. Feb 17 '14 at 18:42
  • @T.S. that exception is at runtime due to 32-bit/64-bit mismatch. If build process `in RELEASE mode` won't copy the Oracle.DataAccess.dll in bin\Release folder then the correct dll would be used from bin32 and bin64 folders. – Brij Feb 17 '14 at 20:00
  • You can create post build event, where you detect configuration and copy appropriate DLL into the output folder – T.S. Feb 17 '14 at 20:06

0 Answers0