.net - C# SMO and SqlEnum references error -
i doing c# project vs2013 using smo object. installed
install-package microsoft.sqlserver.scripting install-package microsoft.sqlserver.sqlenum.dll by nuget
and included
using microsoft.sqlserver.management.smo; using microsoft.sqlserver.management.common; using microsoft.sqlserver.management.smo.agent; but getting following error
error 9 assembly 'microsoft.sqlserver.smo, version=11.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' uses 'microsoft.sqlserver.sqlenum, version=11.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' has higher version referenced assembly 'microsoft.sqlserver.sqlenum, version=10.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91'
any hand?
the problem version mismatch between smo , sqlenum component, exception specifies. problem package, have used install-package microsoft.sqlserver.sqlenum.dll older package sql server 2008.
there folders containing neccessary dll files (microsoft.sqlserver.sqlenum.dll, microsoft.sqlserver.connectioninfo.dll, microsoft.sqlserver.smo.dll) in sql server installation folder:
- sql server 2012
c:\program files\microsoft sql server\110\sdk\assemblies - sql server 2014,2016
c:\program files\microsoft sql server\120\sdk\assemblies
you can install dlls need nuget in 1 package:
2012: https://www.nuget.org/packages/unofficial.microsoft.sqlserver.smo/
2014: https://www.nuget.org/packages/unofficial.microsoft.sqlserver.smo.2014/
included dlls: microsoft.sqlserver.connectioninfo.dll, microsoft.sqlserver.connectioninfoextended.dll, microsoft.sqlserver.management.sdk.sfc.dll, microsoft.sqlserver.smo.dll, microsoft.sqlserver.smoextended.dll, microsoft.sqlserver.sqlclrprovider.dll, microsoft.sqlserver.sqlenum.dll
you should either use microsoft.sqlserver.sqlenum.dll & microsoft.sqlserver.connectioninfo.dll file sdk\assemblies folder have used when creating reference microsoft.sqlserver.smo. or should install matching assemblies nuget. version 11.0.0.0 of dlls stands sql server 2014.
see files , version numbers , create visual c# smo project in visual studio .net.
if install 1 correct package nuget https://www.nuget.org/packages/unofficial.microsoft.sqlserver.smo.2014/, should ok.
Comments
Post a Comment