Visual Studio 2008 allows one to open an existing website by navigating File > Open > WebSite. Alternatively, one may also use the following shortcut: Shift + ALT + O. ![]()
But let’s say you would like to open a website by a right-click folder option. Here’s how to do it using a VS Macro and a Registry Entry:
Open Visual Studio. Select Tools > Macros > Macros IDE. Right-click “MyMacros” and select “New module…” At the prompt, name the module “Website”. Add the VsWebSite.Interop.dll reference(Projects > Add Reference) and copy/paste the follow code over the generated Public “Website” module.
Imports System
Imports EnvDTE
Imports EnvDTE80Imports EnvDTE90
Imports System.Diagnostics
Public Module Website
Sub OpenWebsite(Optional ByVal path As String = “”)
If (String.Compare(path, String.Empty) = 0) Then
MsgBox(“Must supply a folder path to the OpenWebsite macro”,
MsgBoxStyle.OkOnly)
Else
Dim webPkg As VsWebSite.VSWebPackage
webPkg = DTE.GetObject(“WebPackage”)
webPkg.OpenWebSite(path,
VsWebSite.OpenWebsiteOptions.OpenWebsiteOption_None, False)
End If
End Sub
End Module
Now register a shell command enabling an “Open as VS2008 Website” option on any folder in Windows Explorer. Simply, copy/paste the following script into a new “OpenWebsiteVS2008.reg” file.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\OpenVS2008Web]
@=”Open as VS2008 Website”
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\OpenVS2008Web\command]
@=”\”C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe\”
/command \\\”Macros.MyMacros.Website.OpenWebsite %1\\\”"
Execute (double-click) the file to update the Registry accordingly. The “Open as VS2008 Website” option will now be available in Windows Explorer.
That’s pretty damn useful.
God bless you
Please I want to have website with this
Name www. christisalive.co.uk