Microsoft.SqlServer.SqlManagementObjects library not working as expected in .net core
var sql = new Microsoft.SqlServer.Management.Smo.Server();
sql.ConnectionContext.LoginSecure = true;
sql.ConnectionContext.ConnectAsUser = true;
sql.ConnectionContext.ConnectAsUserName = "DomainUser";
sql.ConnectionContext.ConnectAsUserPassword = "Password";
sql.ConnectionContext.ServerInstance = @"Server\Instance";
above code should connect sql server with different user, but it always taking credential of currently logged in user. Its working fine with .Net Framework, only having issues with .Net Core.
Thanks for the reporting the issue.
We’ll take a look at it and prioritize accordingly.
Is there an update on this?