0

Often when you install a Visual Studio Extension to Visual Studio 2012 it gives you an option to restart (with the same project open and just as you left it).

Is there a way to MANUALLY restart Visual Studio with the same project open, for when VS starts running like a dog and intellisense has given up?

I see there are extensions for VS2010 and VS2013, but could not find one for VS2012.

Dib
  • 2,001
  • 2
  • 29
  • 45
  • 1
    If you've got a problem with Intellisense, I'd look to see if its database (ncb file) is corrupt. That would explain the "slow down". – rrirower Aug 30 '16 at 19:50
  • OK, I will give that a go. It is normally ok until VS has been open for over half a day. Then it really needs a restart to get it back up to speed. – Dib Aug 30 '16 at 19:51

1 Answers1

1

You can use the following C# command with my Visual Commander extension:

public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
{
    string vs = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
    string solution = DTE.Solution.FullName;
    DTE.ExecuteCommand("File.SaveAll");
    DTE.ExecuteCommand("File.Exit");
    System.Diagnostics.Process.Start(vs, '"' + solution + '"');
}
Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • I'll try that now. Thank you. – Dib Aug 31 '16 at 08:01
  • Works a treat. Thank you. – Dib Aug 31 '16 at 08:07
  • [What kind of behavior is expected of users?](http://stackoverflow.com/help/behavior) *"Avoid overt self-promotion: The community tends to vote down overt self-promotion and flag it as spam. Post good, relevant answers, and if some (but not all) happen to be about your product or website, that’s okay. **However, you must disclose your affiliation in your answers.**"* – IInspectable Sep 08 '16 at 22:19
  • @IInspectable I've added my affiliation with Visual Commander, though the answer is more about the code that can be used with other Visual Studio extensions. – Sergey Vlasov Sep 09 '16 at 03:29