SQL Server Edition property not available

Category: sql server smodmo


FrederiekD on Mon, 06 Nov 2017 08:18:15


I wrote a .NET application that retrieves the
Server.Edition property for a given SQL Server instance.

The Server class, accessible via namespace Microsoft.SqlServer.Management.Smo, is implemented by assembly Microsoft.SqlServer.Smo.dll.

I ran my application on a system that has SQL Server 2016 Express installed.

Retrieving the Edition property failed with following exception:

Microsoft.SqlServer.Management.Smo.UnknownPropertyException: Cannot read property Edition.This property is not available on SQL Server 7.0.
   at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)
   at Microsoft.SqlServer.Management.Smo.PropertyCollection.GetValueWithNullReplacement(String propertyName, Boolean throwOnNullValue, Boolean useDefaultOnMissingValue)
   at Microsoft.SqlServer.Management.Smo.Server.get_Edition()

My application loads Microsoft.SqlServer.Smo.dll - 10.50.1750.9 ((dac_inplace_upgrade).101209-1051)

The application works fine with SQL Server 2014 and earlier. I have only tested with a single SQL Server 2016 installation. So, I don't know if this is a problem specific to this SQL Server 2016 installation, or if it is a general SQL Server 2016 problem.

Anyone any ideas on this?




FrederiekD on Mon, 06 Nov 2017 13:23:54

Seems like the problem was solved by updating Microsoft.SqlServer.Smo.dll. I'm now using version 13.0.14500.10 ((SSMS_Rel).160415-0249). I got this version from the files installed by Microsoft SQL Server 2016 Management Objects. Now the problem no longer occurs.