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:

  1. Start VS 2005 and create ASPNET Web Application:
    Visual Studio creates solution and project only in subfolder now: /Test5203/Test5203/

  2. Close project

  3. Move project files (*.csproj.user and *.csproj, Properties folder) to the Sitecore distributive root
  4. Open the project (*.csproj file ) from the Sitecore distributive root.
  5. 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:
  6. Make sure that Project Properties -> Ouput Type is Class Library like it is shown .
  7. In order to work with code behind class you should resort to some trick.

  8. Create a layout in Sitecore. Do not include one in the VS project

  9. Create WebForm in VS with the same name and overwrite the existing layout:

  10. 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" %>

  11. 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.

Related reading:

  1. http://webproject.scottgu.com/
  2. http://webproject.scottgu.com/CSharp/Default.aspx
  3. http://webproject.scottgu.com/CSharp/HelloWorld/Helloworld.aspx[

](http://photos1.blogger.com/blogger/6839/1864/1600/addwebform.jpg)