Skip to content

Instantly share code, notes, and snippets.

@motowilliams
Created March 21, 2012 17:06
Show Gist options
  • Save motowilliams/2149583 to your computer and use it in GitHub Desktop.
Save motowilliams/2149583 to your computer and use it in GitHub Desktop.
VS Bouncer
using System;
using EnvDTE;
namespace VSBouncer
{
class Program
{
static void Main(string[] args)
{
var command = args[0];
var solutionPath = args[1];
DTE dte = (DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0");
var solution = dte.Solution;
var fullPath = System.IO.Path.GetFullPath(solutionPath);
if (command.Equals("open", StringComparison.OrdinalIgnoreCase))
solution.Open(fullPath);
if (command.Equals("close", StringComparison.OrdinalIgnoreCase))
solution.Close(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment