Example #1
0
        public static bool Start()
        {
            var debug = Environment.GetEnvironmentVariable(Constants.DebugEnvironmentVariable);

            if (bool.TryParse(debug, out var shouldDebug) && shouldDebug)
            {
                Debugger.Launch();
            }

            var resolveDir = Environment.GetEnvironmentVariable(Constants.BaseDirectoryEnvironmentVariable);

            s_localAssemblyNames = GetLocalAssemblyNames(resolveDir);

            AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
            try
            {
                s_tracer.TraceEvent(TraceEventType.Verbose, 0, Strings.VsStartup.Starting);
                GlobalServices.Initialize();

                s_runner = new VsRemoteRunner();
                s_runner.Start();

                s_tracer.TraceInformation(Strings.VsStartup.Started);
                return(true);
            }
            catch (Exception ex)
            {
                s_tracer.TraceEvent(TraceEventType.Error, 0, Strings.VsStartup.Failed + Environment.NewLine + ex.ToString());
                return(false);
            }
        }
		/// <summary>
		/// This is an internal method, and is not intended to be called from end-user code.
		/// </summary>
		public static bool Start ()
		{
			try {
				GlobalServices.Initialize ();

				runner = new VsRemoteRunner ();
				runner.Start ();

				LocalResolver.Initialize (Directory.GetCurrentDirectory ());

				return true;
			} catch (Exception) {
				return false;
			}
		}