n2cms
Content
n2cms Home
Getting Started using N2CMS
How to get a vanilla N2 project to work in VS2013
How to get a vanilla N2 project to work in VS2013
search
attachments
weblink
advanced
image-effects
image-attributes
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
Colour picker
More colours
Formatting
Strikethrough
Subscript
Superscript
Monospace
Clear formatting
Bullet list
Numbered list
Task list
Outdent
Indent
Align left
Align center
Align right
Page layout
Link
Table
Insert
Insert content
Files and images
Link
Symbol
Emoticon
Markup
Horizontal rule
Insert macro
User mention
Jira Issue/Filter
Info
Status
Gallery
Table of Contents
Jira timeline
Lucidchart Diagrams
Trello Board
Other macros
Page layout
No layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Find/Replace
Keyboard shortcuts help
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account.
<p><span style="color: rgb(37,51,64);">Start VS2013 and create a new project. Select ASP.NET Web Application. Click OK and select Empty template and select to add core references for MVC. Now right click on references and select Manage NuGet Packages. Mark Online and search for n2cms. Install N2CMS and Dinamico Templates for N2 CMS </span><br /><br /><span style="color: rgb(37,51,64);">Go to Server explorer and right click on data connections and select Create new SQL Server Database. Enter (localdb)\v11.0 for the server name and n2 for the database. Right click on the new database in Server Explorer and select Browse in SQL Server Object Explorer. Right click on the database and select Properties. Copy the contents of Data File. In my case it was “C:\Users\Fredrik\n2.mdf”. </span><br /><br /><span style="color: rgb(37,51,64);">Now edit web.config and create a connectionString like: </span><br /><span style="color: rgb(37,51,64);"><add name="N2CMS" connectionString="Data Source=(localdb)\v11.0; ;AttachDbFilename=C:\Users\Fredrik\n2.mdf;Initial Catalog=n2;Integrated Security=True;" providerName="System.Data.SqlClient" /> </span><br /><br /><span style="color: rgb(37,51,64);">Alternatively you could move the database file to your project App_Data folder and reference it through: “|DataDirectory|\n2.mdf” </span><br /><br /><span style="color: rgb(37,51,64);">Right click on the connection to your database in Server Explorer and select Close Connection. </span><br /><br /><span style="color: rgb(37,51,64);">Run your project by hitting F5. Fix the problem with dual <validation> nodes in web.config caused by the n2 installation. </span><br /><br /><span style="color: rgb(37,51,64);">Go through the n2 installation wizard, set your password, create database tables, import content package, and on step 3 click on the link to the management UI and your faced with this nasty error: </span><br /><span style="color: rgb(37,51,64);">[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection </span><br /><br /><span style="color: rgb(37,51,64);">To fix the problem you need to add this to <runtime><assemblyBinding> in web.config </span><br /><span style="color: rgb(37,51,64);"><dependentAssembly> </span><br /><span style="color: rgb(37,51,64);"><assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" /> </span><br /><span style="color: rgb(37,51,64);"><bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </span><br /><span style="color: rgb(37,51,64);"></dependentAssembly></span></p>
Save
Close
Edit
Preview
View changes
Revert to last published version
{"serverDuration": 218, "requestCorrelationId": "115a4d243a5e480e869f99c6e5befaf0"}