Javascript implemented with ComSourceInterfaces is not getting executed when device guard is on RRS feed

  • Question

  • Hi,

    We have implemented COM control and exposed COM event via ComSourceInterfaces and implemented the same in Javascript.

    But whenever device guard (windows defender) is turned on this java script is not getting called.


    COM control is embedded in HTML page and is displayed  in web browser control on a winform.

    Code: COM and ComSourceInterfaces

    namespace Test
        [ClassInterface(ClassInterfaceType.AutoDual), ComSourceInterfaces(typeof(TestEvents_New))]

        [PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]

        public partial class UserControl1: UserControl
            public UserControl1()

            private void Display_Click(object sender, EventArgs e)

                if (OnTestEvent_New != null)

                    string usrinput = textBox1.Text;
                    MessageBox.Show("Calling java script with " + usrinput,"User Control");
                    object comObject = OnTestEvent_New.Target;

                    if(comObject == null)
                        MessageBox.Show("Com object is null");

                    MessageBox.Show("Not able to Call java script no event handlers");

            public event ControlEventHandlerTest OnTestEvent_New;


        public delegate void ControlEventHandlerTest(string UserText);

        /// <summary>
        /// This interface shows events to javascript
        /// </summary>

        public interface TestEvents_New
            //Add a DispIdAttribute to any members in the source interface to specify the COM DispId.
            void OnTestEvent_New(string UserText); //This method will be visible from JS

    HTML and JavaScript:

    <!DOCTYPE html>


        <div>User Text:<h1 id="Header"></h1></div>

        <object id="SaveIssue_New" classid="clsid:EEE8DC12-B436-43CD-B306-55C7FC2BF9FB" codebase=""></object>

        <script language="javascript">
            function SaveIssue_New::OnTestEvent_New_Handler(UserText)

    document.getElementById('Header').innerHTML = UserText;


    Tuesday, June 12, 2018 3:46 AM

All replies

  • Hi SUJAI CN,

    Thank you for posting here.

    For your question, have you check that when you turn on the windows defender, does the COM/ port be disabled?

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, June 14, 2018 7:26 AM