1

I am using some sql server dependencies in a console app:

Imports Microsoft.SqlServer.Management.Common
Imports Microsoft.SqlServer.Management.Smo

When I run on server without sql server install, I hit this error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
embly 'Microsoft.SqlServer.SqlEnum, Version=11.0.0.0, Culture=neutral, PublicKey
Token=89845dcd8080cc91' or one of its dependencies. The system cannot find the f
ile specified.
Alvin
  • 8,219
  • 25
  • 96
  • 177
  • The error seems self-explanatory. Perhaps the dependencies are available only if SQL Server is installed. – sblandin Jun 12 '15 at 09:56

1 Answers1

0

Go ahead and provide your included Library´s within your project folder. And embed them in your project. (Not the ones on the "Programm Files" folder)

The DLL´s should be located at: C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies

(or C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies on 64-bit systems).

You need to add atleast these DLL`s:

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

Otherwise you could use the SQLServer Compact Edition to your Project, to have a fully functional Setup.

Sonorpearl
  • 57
  • 7