3

Background: I'm developing an ASP.NET web application that will developed in Visual Studio 2010 on Windows XP 32 bit OS (company standard, cannot change). The target server is a Windows 2008 Server 64 bit (IIS 7). The application will be referencing an unmanaged dll (Oracle ODP.NET, 11.2) that has both 32 bit and 64 bit versions.

Question: In general, what is the best approach to develop a .NET application that references an unmanaged dll that has both 32 bit and 64 bit versions from a 32 bit OS development environment that deploys to a 64 OS? One solution mentioned was to switch to 32 bit mode in IIS, but I would like to keep the performance gain from the 64 bit driver.

Josh
  • 8,219
  • 13
  • 76
  • 123
  • I've had issues with this as well. I think that @Joel is correct, you'll need both 32 and 64 bit dll's. If this is a web app, a further issue is that the built-in casini webserver is 32 bit and it will crash with a "BadImageFormatException" when trying to load the 64 bit Oracle driver. – Trey Carroll May 06 '11 at 15:40

1 Answers1

1

If the name of the DLL is the same for 32 and 64 bit, then just write it for 32, but when deploying for 64 bit, just use the right DLL. It should just work assuming the library used IntPtr for the right things.

Joel Lucsy
  • 8,520
  • 1
  • 29
  • 35