Click here to Skip to main content
6,630,289 members and growing! (22,949 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate License: The Code Project Open License (CPOL)

Catharsis Tutorial 01 - Installing Catharsis

By David O'Sullivan

Detailed guide to installing Catharsis and setting up a Catharsis solution
C#, .NET, ASP.NET, Visual Studio (VS2008), MVC, CEO, Architect, DBA, Dev, Design
Version:8 (See All)
Posted:28 Jun 2009
Views:4,831
Bookmarked:13 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
1 vote for this article.
Popularity: 0.00 Rating: 5.00 out of 5

1

2

3

4
1 vote, 100.0%
5

Catharsis Tutorial 01 - Installing Catharsis

This document outlines a simple step by step process containing everything you need to know to install the Catharsis framework on your computer and create a Catharsis solution.  

Additional information 

The author of Catharsis, Radim Köhler, has added many CodeProject documents on the Catharsis ASP.NET MVS Framework which can be found here: http://www.codeproject.com/info/search.aspx?artkw=catharsis&sbo=kw

The source code for Catharsis can be found here:
http://www.codeplex.com/Catharsis

Other tutorials in this series can be found here:http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=4013680

A printable Word version of this document is available: Download Catharsis_Tutorial_01_-_Installing_Catharsis.zip - 411.14 KB

Prerequisites  

The following prerequisites will be needed:

     • .NET Framework 3.5 SP1

     • Visual Studio 2008
             Team System 2008
             Support for C# and VB.NET (For LinqToXML)

     • MS SQL Server 2005
             With SQL Server Management Studio

     • GuidanceAutomationExtensions
             Download from Microsoft
   
     • Catharsis ProjectBase
             Download from http://www.codeplex.com/Catharsis/
 

 

ASP.NET MVC

This is not a prerequisite, but it will work if you already have it installed as long as it is the latest version. If in doubt and you do not need ASP.NET MVC for any other projects use ControlPanel to remove it from your computer before installing Catharsis. The catharsis framework contains the ASP.NET MVC assemblies so you do not actually need to have it installed.  

catharsis_tutorial_01_001.png

GuidanceAutomationToolkit

       If you intend to expand the functionality of the Guidance you will need this. 

Operating System used in tutorial  

       Operating system used in this tutorial was Windows Server 2003 SP1. 

 

Once the required software is installed you can begin to create a new application.

The following steps will guide you through the process:

  1. Creating a new catharsis project
  2. Creating the database
  3. Running the database wizard
  4. Creating the database tables  
  5. Setting the StartUp project
  6. Checking the config.files
  7. Running Catharsis

Creating a new Catharsis project 

Click on the File -> New -> Project

catharsis_tutorial_01_002.png

Select ProjectBase.Guidance.

catharsis_tutorial_01_003.png
 

Give your application a name and create a file location for it. It is a good practice to use a naming convention like MyCompany.MyApplication.

In older versions of Catharsis it was not possible to name spaces in the file path for the installation location. For example C:\Documents and Settings would not work but this has now been fixed.

Before proceeding to the next step in the set up it is a good idea to create the database which the application will use.

Creating the database

Open Microsoft SQL Server Management Studio. When installing MS SQL Server 2005 you will have been asked if you want to install the server as a named instance. Using a named instance is good practice because it allows multiple servers to run on the same machine. In the example below the name of the computer is AP325373 and the name of the named instance is MSSQL2005. Using Windows authentication is the best option for our purposes. Select the named instance if you have one (otherwise select the default) and click Connect:

catharsis_tutorial_01_004.png

Now right click on Databases and select Add Database:

catharsis_tutorial_01_005.png

Give the database a name, we will use MyApplicationDB in this case:

catharsis_tutorial_01_006.png

Now click on the Options tab:

Select Compatibility Level: Simple

catharsis_tutorial_01_007.png
 

Click Okay and your new database will appear in the list on the right:

catharsis_tutorial_01_008.png

Running the database wizard 

Now go back to VS2008. When you click okay in the New Project dialog and a new one will appear asking for information about the database. Change the name of the database to match the database you created in the last step:

catharsis_tutorial_01_009.png
 

Now click Finish and wait for the framework to create a skeleton architecture for your project.

When this completed a popup is displayed which outlines what needs to be done next:

catharsis_tutorial_01_010.png

A window with some information on the creation of the skeleton code might remain on the screen, this is not important now so just close that window.

catharsis_tutorial_01_011.png

Creating the database tables

So according to the instructions in the popup we will now run some SQL scripts to create tables which are required by the framework.

In VS2008 find the DB_SQLServer folder and open the first script:

catharsis_tutorial_01_012.png

Select all of the text and copy it to the clipboard.

Go back to MS SQL Server Management Studio. Right-click on your database and select New Query.

catharsis_tutorial_01_013.png 

Now paste the text from the SQL script into the window. Change the name of the database which the script will be run on from the default ‘Product’ to the name of your database, MyApplicationDB in this case. Click the Execute button and the script will run to create the database tables that you need.

catharsis_tutorial_01_014.png

(Note it is possible that an error message stating ‘Could not find the stored procedure MyApplicationDB’ can appear when attempting to run the script. If you close MS SQL Server Management Studio and open it again this will help).

Now run the second script in the same way. This script will populate the tables with some data. Remember again to change the database name.

catharsis_tutorial_01_015.png

There is a third table which contains data for optional create table statements for tracking. If you want to use the frameworks built in ability to track changes to entities you should run this script also. Tracking will be described in a later document.

catharsis_tutorial_01_016.png

Take care of the warning message in the SQL script:  

/*
To use tracking also uncomment 
1) Nhibernate.config ProjectBase.Data mapping
2) Data.hbm.TrackedBase.hbm.xml
*/

We will deal with this in a later tutorial.

 

Setting the StartUp project

Now we need to deal with the remaining items listed in the ToDo list pop-up which Catharsis displayed.

Right click on the web project and select ‘Set as Startup Project’.

catharsis_tutorial_01_017.png

Also do this for the Default.aspx file inside that project.

Checking the config files  

Now we need to make some changes so the framework knows how to access our database. Open the web.config file:

catharsis_tutorial_01_018.png

Find the code for the connection string:

  <connectionStrings>
    <add name="ProjectDB" connectionString="Data Source=.\SQL2005;Database=MyApplicationDB;Trusted_Connection=yes;"/>
  </connectionStrings> 

Check that the database name is correct. This should be taken care of automatically if you created your database before running the Guidance as outlined in the steps above.

The same needs to be done in the App.config file in the test project.

catharsis_tutorial_01_019.png

 

Running Catharsis

Now we are ready to test the new solution MyCompany.MyApplication.

Click on the menu Window -> Close All Documents

Now try debugging the solution. Click on the output window by selecting the Output tab in the bottom pane in VS2008 (This is good practice because it allows you to see what is happening during the build) and then select ‘Rebuild Solution’ as shown. We use rebuild instead of build as this ensures that every part of the application will be built.

catharsis_tutorial_01_020.png

It is possible that some references will appear to be broken before the rebuild is carried out but the rebuild will take care of this.

Now click on Debug or press F5 and run the application.

catharsis_tutorial_01_021.png

 

Summary

If no problems have occurred it should be possible to do this in ten minutes. The result is that you have a complete multi-tier architecture on which to base your application without the considerable difficulties of planning and writing the architecture from scratch.

If any users have problems with their installation please let me know and we will work on finding a solution, it is obviously important to supply information on your system and the status of all the prerequisitres listed above.

The next step

Now that you have installed Catharsis it's time to see what you can do with it. In the next tutorial we will look at the Catharsis example solution where you will see how the Catharsis framework handles entities.

Other tutorials in this series can be found here: http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=4013680

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

David O'Sullivan


Member

Location: Ireland Ireland

Other popular ASP.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 28 Jun 2009
Editor: Sean Ewington
Copyright 2009 by David O'Sullivan
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project