tools/VsIdeHostAdapter/TargetAddIn/AgentSide/VsIdeHostAdapter.cs
/// <summary>
/// Creates VS IDE and HostSide inside it.
/// This can be called multiple times in the run if specified to restart VS between tests.
/// </summary>
Creates VS IDE and HostSide inside it.
This can be called multiple times in the run if specified to restart VS between tests.
Creates VS IDE and HostSide inside it . This can be called multiple times in the run if specified to restart VS between tests .
private void InitHostSide()
        {
            Debug.Assert(m_runContext != null);
            try
            {
                m_vsRegistryHive = GetRegistryHive();
                m_additionalCommandLine = GetAdditionalCommandLine();
                lock (m_hostSideLock)
                {
                    CreateHostSide();
                    try
                    {
                        ((ITestAdapter)HostSide).Initialize(m_runContext);
                    }
                    catch (RemotingException remotingException)
                    {
                        SendResult("Remoting Exception in InitHostSide(): " + remotingException.Message, TestOutcome.Warning);
                    }
                    CheckAttachDebugger();
                }
            }
            catch (Exception ex)
            {
                TestRunTextResultMessage textMessage = new TestRunTextResultMessage(
                                            Environment.MachineName,
                                            m_runContext.RunConfig.TestRun.Id,
                                            ex.GetType() + ": " + ex.Message,
                                            TestMessageKind.TextMessage);
                m_runContext.ResultSink.AddResult(textMessage);
                m_runContext.ResultSink.AddResult(new RunStateEvent(m_runContext.RunConfig.TestRun.Id,
                                                                    RunState.Aborting,
                                                                    Environment.MachineName));
                throw;
            }
            m_isHostSideDirty = false;
        }
private void InitHostSide ( ) { Debug . Assert ( m_runContext != null ) ; try { m_vsRegistryHive = GetRegistryHive ( ) ; m_additionalCommandLine = GetAdditionalCommandLine ( ) ; lock ( m_hostSideLock ) { CreateHostSide ( ) ; try { ( ( ITestAdapter ) HostSide ) . Initialize ( m_runContext ) ; } catch ( RemotingException remotingException ) { SendResult ( " " + remotingException . Message , TestOutcome . Warning ) ; } CheckAttachDebugger ( ) ; } } catch ( Exception ex ) { TestRunTextResultMessage textMessage = new TestRunTextResultMessage ( Environment . MachineName , m_runContext . RunConfig . TestRun . Id , ex . GetType ( ) + " " + ex . Message , TestMessageKind . TextMessage ) ; m_runContext . ResultSink . AddResult ( textMessage ) ; m_runContext . ResultSink . AddResult ( new RunStateEvent ( m_runContext . RunConfig . TestRun . Id , RunState . Aborting , Environment . MachineName ) ) ; throw ; } m_isHostSideDirty = false ; }
Creates VS IDE and HostSide inside it.
Creates VS IDE and HostSide inside it .
// Get the "host side" of the host adapter. // Call Initialize for the host side. // If the test run was started under debugger, attach debugger. // Do some error diagnostics.