SOLVED

"Object reference not set to an instance of an object. (SqlManagerUI)"

Copper Contributor

I have installed SSMS 18.10 and I have connected to Azure SQL Managed Instance, then trying to edit

SQL Agent Job always failing to open and resulting is this error

"Object reference not set to an instance of an object. (SqlManagerUI)". Here is the full error.

 

Object reference not set to an instance of an object. (SqlManagerUI)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.OnDeselecting(Object sender, TabControlCancelEventArgs e)
at System.Windows.Forms.TabControl.OnDeselecting(TabControlCancelEventArgs e)
at System.Windows.Forms.TabControl.WmSelChanging()
at System.Windows.Forms.TabControl.set_SelectedIndex(Int32 value)
at System.Windows.Forms.TabControl.ControlCollection.Remove(Control value)
at System.Windows.Forms.Control.ControlCollection.Clear()
at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.InitializeControls()
at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition..ctor(CDataContainer dataContainer, IMessageBoxProvider messageProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems.CreateJobStepSubSystemSsis(AgentSubSystem agentSubSystem, CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems.CreateJobStepSubSystem(AgentSubSystem agentSubSystem, CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider, IServiceProvider serviceProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepSubSystems..ctor(CDataContainer dataContainer, JobStepData data, IMessageBoxProvider messageProvider, IServiceProvider serviceProvider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.get_SubSystems()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.FilterStepCombo(DatabaseEngineEdition engineEdition)
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeStepCombo()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeData()
at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.OnInitialization()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(ISqlControlCollection control, IServiceProvider provider)
at Microsoft.SqlServer.Management.SqlManagerUI.JobSteps.OnDoubleClick(Object sender, MouseButtonDoubleClickedEventArgs args)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.OnMouseButtonDoubleClicked(HitTestResult htArea, Int64 nRowIndex, Int32 nColIndex, Rectangle rCellRect, MouseButtons btn, GridButtonArea headerArea)
at Microsoft.SqlServer.Management.SqlManagerUI.SqlManagerUIDlgGrid.OnMouseButtonDoubleClicked(HitTestResult htArea, Int64 rowIndex, Int32 colIndex, Rectangle cellRect, MouseButtons btn, GridButtonArea headerArea)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.OnMouseDown(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

21 Replies

@NamassivayaI too downloaded SSMS 18.10 today and I'm getting exactly the same issue but it's only on Managed Instance SQL servers, I can see the properties of job steps on other VM's and "On Prem" servers.  Highly frustrating, especially when we keep getting notifications from Microsoft to update.  :(

Same for me, just for SQL Managed Instance. I also thought I would try logging in with SQL Auth as well as AAD just to see. Both the same error. When editing the job step the error is thrown.
I am having to script out with a drop and create to now to make those changes, which is time consuming all in all
I am also having the same problem, id really like to not have to drop and recreate jobs to make minor changes
Downloaded 18.10 yesterday and also having issues. Lame. :\ I uninstalled my whole redgate suite thinking it was one of the addon extensions that was causing the issue. Bad for productivity.

I tried these steps as a work around

1. uninstalled ssms 18.10 version

2. reboot my laptop

3. installed ssms 18.5 version

4. Right click on SSMS.exe " Run as administrator"

These above steps solved my issue.

@Namassivaya Same here. Very annoying.

Anyway, 18.9.2 is ok, just tested, no need to run as admin, works fine even with AAD+MFA auth. 

This happens to me too. Worked well in v.18.9.2 then after updating to v.18.10 I can't create new steps in jobs, nor edit old ones. Have even tried to reinstall to old version (uninstall 18.10 and then install 18.9.2) but it still fails. Weird thing here is that in the splash screen when starting up it says v.18.9.2, but if I look in the about section it still says v.18.10.

i had the problem, i resolved it by fully remove 18.10 then install 18.9 @Carl_Ripa

@cbarroso Yes that worked for when uninstalling a second time, also removing files in %AppData%. No idea what happened the first time. 

Another note is that it seems to work fine in 18.10 if connected to a SQL Server on Linux (maybe other instances as well). But Azures Managed Instances does not work.

@erinstellato link above actually downloaded v19 which also works. Nicer to go forward than backward!
Goodmorning, same problem on 19.1, tried on multiple Windows (10 & 11).
Hi @Leonardo_Cursi - can you please provide the steps to recreate? I just tested with 19.1 against Managed Instance with the following steps:

1. I created a new SQL Agent job that had one step - it just runs a simple select statement (SELECT @@VERSION).
2. I saved the job, and then manually executed it to make sure it worked. (It did.)
3. I then right-clicked on the job and selected Properties.
4. In the properties window, I went to the Steps page, selected the job step, and then selected Edit.
5. I modified the script (added another query - select * from msdb.sys.databases) and then selected OK.
6. I selected OK again from the properties window, and then ran the job again.

I did not encounter any errors. If you are able to share your exact steps, that would be helpful to try and recreate the issue here. Thank you.
I'm ashamed for the delay but I missed your response, Erin. Excuse me.

I followed the suggestions and the two executions were successful. I'm trying to connect to an old 2014 version even though I get, not always to be honest, the same error with sql 2017. In 2014 I get it in this particular error when I try to add a securable to a sql login (I choose the db, expand the security section, right click on the sql login). I'm sysadmin of that instance.


I report the error I get in the advanced information.:

===================================

Object reference not set to an instance of an object. (SqlMgmt)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.SqlMgmt.PermissionsData.Securable.GetImage(SecurableType type)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector.InitializeBitmaps()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, PermissionsDetailsGrid permissionsGrid, Object connectionInfo, Boolean yukonOrGreater)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore.InitializeSecurableSelector()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, Object connectionInfo, Boolean yukonOrGreater, Boolean showColumnPermissionsInDetailsGrid)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.InitializePermissionsCore()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.OnInitialization()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()
Hi, I have this error message after adjusting some Securables on a Database Role and then trying to open Securables again. The same or others, makes no difference.
Using SSMS 19.1 via citrix published apps with RunAs.
I was able to open the Securables at first and added a table and stored procs but wasn't able to open it again to see if my changes were there. Got this error on every attempt, even on different DB connections or different roles.
After closing and restarting my SSMS I can see my result and adjust a role again. After clicking OK when done with my adjustments the window closes and after that the message appears again on every attempt.
Details:
Object reference not set to an instance of an object. (SqlMgmt)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.SqlMgmt.PermissionsData.Securable.GetImage(SecurableType type)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector.InitializeBitmaps()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsSecurableSelector..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, PermissionsDetailsGrid permissionsGrid, Object connectionInfo, Boolean yukonOrGreater)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore.InitializeSecurableSelector()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsOfPrincipalsCore..ctor(IHelpProvider helpProvider, IServiceProvider serviceProvider, Principal principal, Object connectionInfo, Boolean yukonOrGreater, Boolean showColumnPermissionsInDetailsGrid)
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.InitializePermissionsCore()
at Microsoft.SqlServer.Management.SqlMgmt.PermissionsDatabasePrincipal.OnInitialization()
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.OnBeforeSelection(Object sender, TreeViewCancelEventArgs e)

@Tessa_new @Leonardo_Cursi We have these issues logged internally and will address them in the next release of SSMS.  Thank you!

@erinstellato 

Hi, do have SSMS version 19.0 and i am running on Azure Managed Instance, when i do go on users to see Properties, i get the following error message.

 

TITLE: Microsoft SQL Server Management Studio
------------------------------

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:

Cannot show requested dialog. (SqlMgmt)

------------------------------

Object reference not set to an instance of an object. (SqlManagerUI)

------------------------------
BUTTONS:

OK
------------------------------

1 best response

Accepted Solutions
best response confirmed by Namassivaya (Copper Contributor)
Solution
@adamoumagaji I do not have that issue with SSMS 19.3, which is the latest release. Can you please try with SSMS 19.3? Thanks.

View solution in original post