Tuesday, February 10, 2009

DNN – My very first DNN project

I am a newbie with DotNetNuke (DNN) and here is what I needed to do to getting it up and running.

Pre-requisites:

  1. Even though VS 2005 & VS 2008 come with a development web-server (Cassini), DNN folk suggest using a IIS sever for development. So go ahead and install IIS on your machine. (You will need WinXP pro to install IIS though, which I have on my work machine and if you have Vista, I think you will need the home premium edition at a minimum to get IIS).
  2. The best way to start working with DNN is to use their starter kit, which installs Visual Studio templates, that will make life a lot more easier when creating DNN sites.
    http://www.codeplex.com/dotnetnuke/Release/ProjectReleases.aspx?ReleaseId=21018 (
  3. SQL Server 2005 (or 2008).

Starting off:

  1. Create your new DNN site by going to File –> New –> Website.
  2. Select “DotNetNuke Web Application Framework” under templates. (if you cannot see this template – make sure that the language selected is Visual Basic and that you have the starter kit installed).
  3. Select HTTP as your location type and for the path, type in a value such as “http://localhost/DotNetNuke Website”. (This will create a folder under your InetPub/wwwRoot folder with the name DotNetNuke Website). Hit OK. VS will churn for a while and create all the files that you need to run a DNN site.
  4. You arent done yet.
  5. You need to run DNN once to get it to setup your database. I am using a SQL Server 2005 instance, running on a separate server. You can use SQL Server Express running on your local machine instead.
    Create a new database on your SQL Server. Set the owner to a login that has db_owner granted on it.
    Create the connection string for the database you just created. (Tool coming soon, until then, use VS’s server explorer – create your connection and then check the properties for the connection and you should be able to copy out the connection-string created by VS for you.)
  6. Open up the web.config and update the “SiteSqlServer” value with the connection string from (5). There should be 2 places that you need to update this value:
    ConnectionString and AppSettings.
  7. Set the default.aspx file in the root of the website as the start-up file.
  8. Hit CTRL+F5 to start the app without debugging. If everything went correctly up to this stage, you should see the installation page. If not, go to the beginning and see if you missed a step (permissions on folders and database are typical causes). If you cannot get the installation page – then you are out of luck on this post!
  9. Once the installation page is up and running, select the typical installation option. On the next page, DNN should have picked up most of the settings from the SiteSQLServer key in the web.config file. You will have to type in the database password. The rest of the settings for the installation are pretty mundane.

Problems I had:

  • After creation and installation of DNN, when I tried to run DNN, I got 6 errors – all of them relating to “DotNetNuke.FckHtmlEditorProvider.dll”:
    • Could not load type 'DotNetNuke.HtmlEditor’.
    • Could not load type 'DotNetNuke.HtmlEditor.FckHtmlEditorProvider.fckStyles'.
    • Could not load type 'DotNetNuke.HtmlEditor.FckHtmlEditorProvider.fckimagegallery'.
    • Could not load type 'DotNetNuke.HtmlEditor.FckHtmlEditorProvider.fckCSS'.
    • Could not load type 'DotNetNuke.HtmlEditor.FckHtmlEditorProvider.fcklinkgallery'.
      To get it working again, all I had to do was move the “DotNetNuke.FckHtmlEditorProvider.dll” from the BIN\Providers folder, to the BIN folder.
  • Error about website not being able to view the directory.
    • This is most probably because you havent set the default.aspx as the start up page.
  • Various errors about files and folders:
    • Check your folder permissions. I gave the local ASPNET and NetworkServices account modify privileges on the website folder and all its children.

No comments: