-
Notifications
You must be signed in to change notification settings - Fork 151
Setup development environment
- Remote or local SQL Server / SQL Server Express
- .NET Framework >= 4.5
- IIS with ASP.NET
- Mvc >= 5
- Git client
- Full Trust Level
- Visual studio with Razor generator tool: required for pre-compiling Razor views.
- Ensure all pre-requisites are installed.
- Clone the Git repository to your local disk. Use
git@github.com:devbridge/BetterCMS.git
for cloning. - Add the following line to the hosts file (it should be edited in Administrator mode):
127.0.0.1 bettercms.sandbox.mvc4.local.net
This file can be found in c:\Windows\System32\drivers\etc\hosts
and should be edited in Administrator mode.
- Open IIS Manager. Right click on "Sites" and choose "Add Website":
- Enter these values:
Site Name: bettercms.sandbox.mvc4.local.net
Physical path: browse
\Sandbox\BetterCms.Sandbox.Mvc4
folder in the cloned project directory Host Name: bettercms.sandbox.mvc4.local.net
- Go to "Application Pools", find the pool
bettercms.sandbox.mvc4.local.net
and check if the .NET Framework version is v4.0:
- If the current version is not v4.0, double click on your pool and choose
.NET Framework v4.{xxxxx}
from the .NET frameworks list.
- Open a project in Visual Studio or Visual Studio Express.
- Create a database in SQL Server or SQL Server Express and ensure "Application Pool Identity" has read/write access to that database. To read more on this fix, visit troubleshooter.
- Open
BetterCms.Sandbox.Mvc4\Config\connectionString.config
for editing and enter the connection string. Read more about connection strings here.
- Ensure, that
BetterCms.Sandbox.Mvc4
project is set as the start-up project (it should be displayed in bold). If it's not, press the right mouse key on the project and select "Set as StartUp Project".
- Run the solution by pressing "F5" or navigating to "Debug -> Start Debugging". If the database and ISS server are configured correctly, the website will create it's database structure. It could take some time, so please be patient. Eventually, Better CMS should open it's home page. Better CMS is running and content can be edited.
From the version 1.8.0, pre-compiled views are used. The Razor generator tool should be used for generating .cs
files from .cshtml
files. The Razor generator tool can be downloaded here: http://visualstudiogallery.msdn.microsoft.com/1f6ec6ff-e89b-4c47-8e79-d2d68df894ec
When a save is performed, EditSeo.cshtml
, EditSeo.generated.cs
is updated.
If a new Razor view is to be created, Build Action
should be set to None
and Custom tool
should be set to RazorGenerator
(in file properties):
Otherwise, the view will not be pre-compiled and will not be found when running the module.
You can read more about using Razor generator here: http://blog.davidebbo.com/2011/06/precompile-your-mvc-views-using.html
By default, when the application pool is created, ApplicationPoolIdentity is chosen as the pool's identity. It can be changed to another user, for example, "NetworkService".
Open "IIS -> Application Pools" and select the application pool bettercms.sandbox.mvc4.local.net
. From the context menu (or from the menu on the right) choose "Advanced Settings...". Find "Identity" and press the "Browse" button next to it. Change the built-in account to "NetworkService".
Open the 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 the context menu.
Enter NT AUTHORITY\NETWORK SERVICE as login name, keep Windows authentication mode checked.
Open the "User Mapping" page, select your database and ensure that db_owner and public checkboxes are checked.
Press "OK" and try reloading the page. Now the NetworkService account has access to the database and Better CMS should run correctly.