Open Website in Visual Studio through Command Line?

Last post 12-06-2005 1:37 PM by danmor. 2 replies.

Sort Posts:

  • Open Website in Visual Studio through Command Line?

    12-05-2005, 1:28 PM
    • Contributor
      4,100 point Contributor
    • Scott Mitchell
    • Member since 06-15-2002, 8:41 PM
    • San Diego, CA
    • Posts 707
    • ASPInsiders
      TrustedFriends-MVPs
    Does anyone know if it's possible to open a file system-based website in VS2005 through the command-line? The devenv.exe command-line switches allow you to pass in a project or solution file, but I want to just pass in a directory path and have that open. I noticed that the command-line switches let you specify a command as well, and that VS2005 has a File.OpenWebSite command, but that command just displays the Open Website dialog box - it seemingly does not not allow you to pass in a directory path.

    Any ideas or suggestions?

    My end goal is to be able to, through Windows Explorer, right-click on a folder and choose a menu option that says, "Open in Visual Studio", and doing so would open VS2005 and open the website from that folder's path.

    TIA
    Happy Programming!


    -- Scott Mitchell
    -- mitchell@4guysfromrolla.com
    -- http://scottonwriting.net/sowblog/
    -- http://www.4GuysFromRolla.com/ScottMitchell.shtml
  • Re: Open Website in Visual Studio through Command Line?

    12-05-2005, 9:50 PM
    • Contributor
      4,100 point Contributor
    • Scott Mitchell
    • Member since 06-15-2002, 8:41 PM
    • San Diego, CA
    • Posts 707
    • ASPInsiders
      TrustedFriends-MVPs

    I ended up finding a way to do this, although it's a bit dirty. Essentially I wrote a program that creates a 'garbage' project file and then calls VS, opening the project. End story, I can right-click on a folder in Windows Explorer, choose "Open as Website", and the website will be opened in VS.

    More on my technique, along with the code and an explanation at my blog: Quickly Opening a Visual Studio Website Project.

    Happy Programming!


    -- Scott Mitchell
    -- mitchell@4guysfromrolla.com
    -- http://scottonwriting.net/sowblog/
    -- http://www.4GuysFromRolla.com/ScottMitchell.shtml
  • Re: Open Website in Visual Studio through Command Line?

    12-06-2005, 1:37 PM
    • Contributor
      4,570 point Contributor
    • danmor
    • Member since 11-04-2002, 9:48 PM
    • Bellevue, WA
    • Posts 910
    • AspNetTeam
    As you describe in your blog, opening a solution in devenv from a command line does work, but opening a web site from a command line was never in the spec and thus was never expected to work.  Clever solution creating the solution file.  I'm not aware of any other back doors opening as web sites from the command line.  It's a good idea and I'll open a suggestion bug on it.
    -Dan
    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (3 items)