Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Failed to load assembly Microsoft.SqlServer.SqlEnum When ILMerge all SQL2017 Assembly and refer it

$
0
0

Hi,

We created one DB Operation component for my setup.

This components was refer SMO objects from Installed package until SQL 2014.

Now SQL 2017 SMO objects are moved into NuGet. So we downloaded and merged part of existing components using ILMerge.

In this all SQL SMO components are working fine except Microsoft.SqlServer.SqlEnum.

Ex.           

   Microsoft.SqlServer.Management.Common.SqlConnectionInfo sci;
   Microsoft.SqlServer.Management.Smo.ServerLoginMode securityMode;

            sci = new SqlConnectionInfo(instance, username, password);
            ServerConnection serverCon = new Microsoft.SqlServer.Management.Common.ServerConnection(sci);
            Server srv = new Server(serverCon);

            securityMode = srv.Settings.LoginMode; // Exception raising here..

Exception:

Its current value is 'DatabaseOperations.getSecurityMode: 
SQL server ERROR 'Microsoft.SqlServer.Management.Sdk.Sfc.InternalEnumeratorException: failed to load assembly Microsoft.SqlServer.SqlEnum. ---> System.IO.FileNotFoundException: 
Die Datei oder Assembly "Microsoft.SqlServer.SqlEnum, Culture=neutral, PublicKeyToken=null"






Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>