StartMonitorShare doesn't work on Window C# Api

StartMonitorShare doesn’t work on Windows C# Api. Using the current API zoom-c-sharp-wrapper-5.11.10.8250.zip

I’m seeing this When share screen is done using zoom windows sdk application gets hanged and nothing works - Meeting SDK / Windows - Zoom Developer Forum exact thing… so it is reproducible…don’t take that ‘we can’t reproduce it’ BS with me I won’t stand for it…

SDKError error = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController().StartMonitorShare(“\\.\DISPLAY1”);

when hardcoding to the string return from windows it just freezes? What’s going on how do I fix this?

so I solved this by doing a couple things.

Add this to your main

if (null == System.Windows.Application.Current)
{
   new System.Windows.Application();
}

then in your share screen method wrap the call to the Zoom C# api in an action and Invoke it on the Application Dispatcher

public void startScreenShare(bool enableSound, bool optimizeForVideo, string monitorID)
{
    if (CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController().CanStartShare())
    {
        var controller = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController();

        Action action = new Action(() =>
        {
            SDKError error = controller.EnableOptimizeForFullScreenVideoClip(optimizeForVideo);
            if (error == SDKError.SDKERR_SUCCESS)
            {
                Console.WriteLine("SDKERR_SUCCESS EnableOptimizeForFullScreenVideoClip {0}", error);
            }
            else
            {
                Console.WriteLine("ERROR EnableOptimizeForFullScreenVideoClip {0}", error);
            }
            error = controller.EnableShareComputerSound(enableSound);
            if (error == SDKError.SDKERR_SUCCESS)
            {
                Console.WriteLine("SDKERR_SUCCESS EnableShareComputerSound {0}", error);
            }
            else
            {
                Console.WriteLine("ERROR EnableShareComputerSound {0}", error);
            }
            int index = 0;
            try
            {
                index = int.Parse(monitorID);
            }
            catch (Exception e)
            {

            }
            //string monitorId1 = Screen.PrimaryScreen.DeviceName.ToString();
            //SDKError error = ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingShareController().StartMonitorShare(monitorId1);
            error = controller.StartMonitorShare(Screen.AllScreens[index].DeviceName);
            if (error == SDKError.SDKERR_SUCCESS)
            {
                Console.WriteLine("SDKERR_SUCCESS StartMonitorShare {0}", error);

            }
            else
            {
                Console.WriteLine("ERROR StartMonitorShare {0}", error);

            }
        });
        System.Windows.Application.Current.Dispatcher.Invoke(action);
    }

    else
    {
        Console.WriteLine("ERROR CanStartShare");
    }
}

also if the C# wrapper is not maintained by Zoom then why is it only available via a gatekept Zoom link? It used to be maintained on Github but that has been replaced with documentation that says Zoom has it. Like if you are going to gatekeep something you need to support it.