hi,
could not instantiate object Microsoft.SqlServer.Management.Smo.AvailableSQLServers.
Please check if the following discussion solve your issue:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi.
have developing an App in .net 6.0 framework for which need to enumerate sql server instances available in the network domain. When calling below code
added nuget packages Microsoft.SqlServer.Management objects
System.Data.SqlClient,
Microsoft.Windows.Compatibility
Microsoft.SqlServer.Management.Smo --> SmoApplication.EnumAvailableSqlServers(false) throws following error
could not instantiate object Microsoft.SqlServer.Management.Smo.AvailableSQLServers.
at Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.CreateObjectInstance(Assembly assembly, String objectType)
at Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.CreateObjectInstance(String assemblyName, String objectType)
at Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.LoadElement(ObjectLoadInfo oli)
at Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.LoadFirstElementVersionless(Urn urn, Object ci)
at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetServerVersion(Urn urn, Object ci)
at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetObjectInfo(Object ci, RequestObjectInfo req)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetObjectInfo(Object connectionInfo, RequestObjectInfo requestObjectInfo)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.FixPropertyList(Object connectionInfo, Urn urn, String[] fields, RequestFieldsTypes requestFieldsType)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
Same code works fine in framework 4.8.
Can some one give pointers?
Regards,
Phani.
hi,
could not instantiate object Microsoft.SqlServer.Management.Smo.AvailableSQLServers.
Please check if the following discussion solve your issue:
we need to populate all the servers in network domain, this doesnt seem to work for me.
Hi! Have you solved this problem?
No. the problem is not solved