3

My machine is running 64 bit windows with Visual Studio 2015 + SQL Server 2014 express.

I need to create the client application with SMO that should run on both 32 bit and 64 bit machines. I just read the Microsoft MSDN document about how to reference SMO. So I know that I need to reference these dll files:

Microsoft.SqlServer.ConnectionInfo.dll, 
Microsoft.SqlServer.Smo.dll, 
Microsoft.SqlServer.Management.Sdk.Sfc.dll, 
Microsoft.SqlServer.SqlEnum.dll

But I am confused a bit as these files are present in 2 folders:

  • C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\

  • C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\

If any one can suggest me what approach should I use.

  1. Configure my project for separate builds for 32 and 64 bit and reference the corresponding SMO dlls using the technique described here. (This will lead to 2 different exe files for 32bit and 64bit, so I need to create different installer for both platforms! correct me if I am wrong)

  2. Keep one build configuration i.e. AnyCPU is my project and reference the dlls from C:\Program Files (x86)\ only. (Will it work?)

I know this can lead to open discussion, but I am more interested if anyone can confirm whether solution 2 works for me. And why should I prefer solution 1 over solution 2.

Ahmad.Tr
  • 756
  • 7
  • 22
MJ Khan
  • 1,696
  • 3
  • 21
  • 36
  • This question is quite old. I am adding my final finding to conclude this question from my side. I ended up with using only x86 configuration for application, and it can run on both 32 and 64 bit Windows. I decided this as 64 bit applications are slower (http://stackoverflow.com/questions/12979774/net-4-0-app-slower-on-64-bit-than-32-bit-profiling-and-possible-solutions-ap). So I only need 32 bit dlls and only one exe/installer. – MJ Khan Oct 22 '16 at 03:50

0 Answers0