Setting up a new EPiServer project on Windows 7 and IIS7.5

I don’t know about you, but I always prefer to have my development environment as close to what is on the live servers as possible. As such, I always prefer to develop using IIS and a locally pointed domain rather then either Cassini, Visual Studio’s inbuilt web server, or IIS Express, accessed via localhost and a port number.

Setting up an EPiServer development environment is one of those jobs that only gets done once in the lifetime of the project, and as such, I always find myself having to remind myself how to do it. Here are my steps to set up my favoured development environment.

NOTE: These steps have only been tested using Windows 7, IIS 7.5 and EPiServer CMS 6 R2. I have not tried it on other platforms and with other versions of EPiServer.

Create an EPiServer project

The first step is to create a EPiServer project within Visual Studio. As long as you have installed EPiServer CMS and the SDK you should have an EPiServer folder in your New Project dialog window.

All you need to do is put in the project name and press OK.

Change the project to .Net 4

You need to save and close the solution before doing this. Once you have re-opened the solution select the project properties.

On the Application tab change the Target Framework to .Net 4.

Make changes to the Web.config

There are a number of changes you will need to make to the web.config file. These are detailed in articles by  Allan Thræn and David Knipe. If you are a user of NuGet, there is a package called EPiServerCMS6ToNetFour available which will do the changes for you.

Create the VPP folder

A VPP folder is created as part of the project, but it is in the developers user profile folder and, as it uses the %USERPROFILE% variable, it will cause an error when the site is running within IIS.

To fix this, create a new VPP folder, with the required sub folders (Globals, Documents and PageFiles by default) and replace the %USERPROFILE% variable with the absolute file path to here.

Create a blank EPiServer database

The out of the box EPiServer project creates an EPiServerDB.mdf file in the App_Data folder. As other developers may need to access the database and because I prefer to have the development environment as close to live as possible I want the database to be hosted on a proper SQL Server database.

Using EPiServer Deployment Centre create a new, blank database on the appropriate SQL Server instance and then change the connection string in connectionStrings.config to point to it.

Create a new domain, website and app pool

Firstly create an entry in your hosts file for the domain you are going to be using to access the site. This needs to point to the local machine ip, i.e. 127.0.0.1.

Once this is done the episerver.config file needs editing to set the siteUrl attribute of siteSettings node needs to be set to the new domain name.

Next, open IIS Manager and create a new Website. Point the folder to your EPiServer projects website development folder and bind it to the domain name you added to your hosts file.

Lastly, change the app pool used by your new website to be .Net 4 and to use Intergrated Pipeline mode.

Lastly, get a EPiServer licence key

As the site is not being accessed by localhost, but by a domain name you will need a EPiServer licence to work with this. Demo and partner developer licences are available from the EPiServer Licence Center website.

Developing in Visual Studio as Administrator

You now have, hopefully, a fully working EPiServer development environment using your local IIS server. The one down side of this is that you may need to run Visual Studio as Administrator. This is due to requiring various privileges, but I think this is a small price to pay.

 

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>