This blog post describes how to link Sitecore Rocks connection to a Visual Studio project using the Sitecore ASP.NET CMS. For more information about Sitecore Rocks, see my blog post Introducing Sitecore Rocks.
As I mentioned in my blog post Sitecore Rocks Connections, Sitecore Rocks connections "are not part of Visual Studio projects or solutions". While that might be techincally accurate, it is actually possible and recommended (but not mandatory) to link a Sitecore Rocks connection to Visual Studio project. As you can guess from the notes below, multiple Sitecore projects can share a Sitecore Rocks connection. So far, it appears to me that the primary benefit is synchronizing files and items as described briefly below.
To link a Sitecore Rocks connection to a Visual Studio project:
Assuming a C# project, linking a Sitecore Rocks connection to a Visual Studio project creates a .csproj.sitecore file in the same subdirectory as the existing .csproj file. The .csproj.sitecore file maintains information about the connection and a mapping between files and definition items.
In Visual Studio Solution Explorer, if you right-click the project after linking it to a connection, the Sitecore menu contains additional entries such as to disconnect or update the Sitecore Rocks connection.
More importantly, when you use Visual Studio to create a resource that involves both a file and a definition item (such as a layout, sublayout, or XSL rendering), Sitecore prompts for confirmation to create the corresponding definition item:
If Visual Studio may prompt you to trust the template, click Trust:
If you rename the file using Visual Studio, Sitecore updates the Path field in the definition item (but does not rename the definition item).
I hadn't set this as a goal, but accounting for over 30 reposts from around November of 2010, this appears to be about my hundredth blog post since moving my blog to https://sitecore.com last year. For the full archive, see https://www.sitecore.com/en/Community/Technical-Blogs/John-West-Sitecore-Blog/Archive.aspx.
Congratulations on your 100th blog post - Sitecore is very lucky to have you on board. Keep up the good work:-)
Hi John I am not able to see the local IIS sites in the Sitecore explorer. is there any chance you can help me ?
Hi there. Have you been able to successfully add a new site connection through the Sitecore explorer window. A local Sitecore instance should appear under the "connections" node after the connection is set up. If you are referring to the <Local IIS Sites> node in the Sitecore explorer then I don't think it is necessary. Sitecore instances should usually be listed under the "connections" node instead of the "<Local IIS Sites>" node.
Hi Scott, Many many thanks for your quick response, yes I have managed to connect to the instance i have and then moved the server into lodal IIS sites ;) Thanks Jawad
Hi In Windows 8 and later, the IIS has been locked down and can only be access by an administrator. This means that if you run Visual Studio as a non-administrator the <Local IIS Sites> does not appear. Unfortunately accessing IIS without being an administrator crashes the application. To have the <Local IIS Sites> appear in the Sitecore Explorer you need to both run VS as administator and set Tools | Options | Sitecore | Options | Disable IIS Integration to False.
Thanks this article is good :)