Skip to content

Setup development environment

Audrunas Matonis edited this page Jul 8, 2014 · 15 revisions

Pre-requisites:

  • Remote or local SQL Server / SQL Server Express
  • .NET Framework >= 4
  • IIS with ASP.NET
  • Mvc >= 3
  • Git client

Install instructions

  • Check if all pre-requisites are installed.
  • Clone the Git repository to your local disk. Use git@github.com:devbridge/BetterCMS.git URL for cloning.
  • Add this line to the hosts file (it should be edited in Administrator mode):
127.0.0.1  bettercms.sandbox.mvc4.local

This file can be found in c:\Windows\System32\drivers\etc\hosts and should be edited in Administrator mode.

hosts file

  • Open IIS Manager. Right click on sites and choose "Add Website":

IIS: add website

  • Enter these values: Site Name: bettercms.sandbox.mvc4.local Physical path: browse \Sandbox\BetterCms.Sandbox.Mvc4 folder in the cloned project directory Host Name: bettercms.sandbox.mvc4.local

IIS website settings

  • Go to Application Pools, find pool bettercms.sandbox.mvc4.local and check if .NET Framework version is v4.0:

IIS: application pool

  • If version is not v4.0, double click on your pool and choose .NET Framework v4.{xxxxx} from the .NET frameworks list.

Application pool: .NET framework version

  • Open project in Visual Studio or Visual Studio Express.
  • Create database in SQL Server or SQL Server Express and ensure Application Pool Identity has read/write access to that database. Read more in troubleshooter, how it can be fixed.
  • Open BetterCms.Sandbox.Mvc4\Config\connectionString.config for editing and enter your connection string. Read more about connection strings here.

Edit connection string

  • Ensure, that BetterCms.Sandbox.Mvc4 project is set as startup project (it should be displayed in bold). If it's not, press right mouse key on the project and select Set as StartUp Project.

Set project as startup project

  • Run solution by pressing F5 or Debug -> Start Debugging. If database and ISS server are configured correctly, website will create it's database structure. It could take some time, please be patient. After some time Better CMS should open it's home page. Better CMS is running and can be edited.

Troubleshootings

Database is inaccessible to application pool's identity

By default, when application pool is created, ApplicationPoolIdentity is chosen as pool's identity. It can be changed to another user, for example, NetworkService. Open IIS -> Application Pools and select application pool bettercms.sandbox.mvc4.local. From the context menu (or from the menu on the right) choose "Advanced Settings...". Find "Identity" and press browse button next to it. Change Built-in account to "NetworkService".

Change application pool identity

Open SQL Server Management studio. In the object explorer expand Security and Logins. If there is no NT AUTHORITY\NETWORK SERVICE, add it by choosing New login from context menu.

New login

Enter NT AUTHORITY\NETWORK SERVICE as login name, keep Windows authentication mode checked.

New login form

Open User Mapping page, select your database and ensure, that db_owner and public checkboxes are checked.

User mappings

Press OK and try reloading page. Now NetworkService account has access to database and Better CMS should run correctly.

Clone this wiki locally