Example #1
0
        public int LaunchFile(string file, bool debug)
        {
            if (!File.Exists(file))
            {
                _project.Build("Build");
            }
            var processStartInfo = CreateProcessStartInfo(file, debug);

            Process.Start(processStartInfo);
            return(VSConstants.S_OK);
        }
        private string GetProjectStartupFile()
        {
            var startupFilePath = Path.Combine(project.GetProjectProperty("TargetDir"), project.GetProjectProperty("TargetFileName"));

            if (string.IsNullOrEmpty(startupFilePath))
            {
                throw new ApplicationException("Visual Rust could not resolve path for your executable. Your installation of Visual Rust or .rsproj file might be corrupted.");
            }

            if (!File.Exists(startupFilePath))
            {
                project.Build("Build");
            }

            return(startupFilePath);
        }