Due to the different approach of creating a new web project in VS 2005, some tricks should be made to create a Sitecore project.
Firstly, you need to download and install
Then you need to perform the following steps in order to get a similar functionality for working with Web Project like it was in VS 2003:
Start VS 2005 and create ASPNET Web Application:
Visual Studio creates solution and project only in subfolder now: /Test5203/Test5203/
- Move project files (*.csproj.user and *.csproj, Properties folder) to the Sitecore distributive root
- Open the project (*.csproj file ) from the Sitecore distributive root.
- Exclude the default.aspx page from the project.
Now you can add necessary assemblies, include some layouts and sublayouts in project as it was before:
- Make sure that Project Properties -> Ouput Type is Class Library like it is shown .
In order to work with code behind class you should resort to some trick.
Create a layout in Sitecore. Do not include one in the VS project
Create WebForm in VS with the same name and overwrite the existing layout:
Add missing directives at the top of the layout: <%@ OutputCache VaryByParam="none" Duration="100" %><%@ register TagPrefix="sc" Namespace="Sitecore.Web.UI.WebControls" Assembly="Sitecore.Kernel" %>
If you want to work with code-behind class, you should replace the CodeBehind page attribute with the CodeFile attribute:<%@ Page language="c#" Inherits="Viewstate.layouts.Main_Layout" Codepage="65001" CodeFile="Main Layout.aspx.cs"%>
Well, that’s all. Now you can work in VS 2005 like it was in VS 2003 - compile, attach to ASPNET process, debug code etc.