Sunday, March 30, 2008

creating MSDN-style documentation from .NET assemblies - SandCastle

Introduction: Sandcastle is a command line based tool created by Microsoft, used for creating MSDN-style documentation from .NET assemblies and their associated XML comments files. Sandcastle Help File Builder is to provide graphical and command line based tools to build a help file in an automated fashion.

Simple steps to generate help files for your assemblies 
=====================================

I. Softwares to be installed:
SandCastle - http://www.codeplex.com/Sandcastle
SandCstle help file builder - http://www.codeplex.com/SHFB

II. Configuration in Visual studio
Configure Visual studio to generate XML comment file along with assemblies

Project properties -> Build tab -> check “XML documentation file”

III. Configure SandCastle Help Builder
Create a new project and add your assembly to the project. Once you added assemblyname it appears with xml comment file. It looks like ”MyAssembly.dll, MyAssembly.xml”.

IV. Finally build help file
In SandCastle Help Builder -> Goto “Documentation” menu -> Build Project

Once you build project, It saves help project file as well once it gets build you will have your html help file.

****END**** 

 

Posted by in 15:15:34 | Permalink | No Comments »

SubSonic step by step

  

SubSonic step by step

I. SubSonic is a toolset that helps to

  1. Generate DAL layer
  2. Maintains and Generates SQL Script for DB Versioning
  3. Dynamic Query tool helps to use SQL Server etc without knowing SQL
  4. OR Mapper that extends to views and stored procedures

II. Installation

  1. Download SubSonic @ http://www.codeplex.com/subsonic/Release/ProjectReleases.aspx?ReleaseId=5636
  2. Install SubSonic by walking through steps, by default it stores at “Program Files\SubSonic\SubSonic 2.1 Beta 2\SubSonic”

III. Configuring inside Visual Studio 2005/ 2008 to use SubSonic

  1. Create new Website project
  2. Create another new class library project say ‘NorthWindDAL’ and add to solution as shown below (this project is going to act as DAL layer for web project)

  1. Add application configuration file to ‘NorthWindDAL’ class library (app.config)
  2. Create folder in NorthWindDAL project to keep all Subsonic generated classes
  3. Add below configuration sections to app.config file of NorthWindDAL project
    1. Add configsection

<configSections>
                  <section name=SubSonicService
                         type=SubSonic.SubSonicSection,SubSonic
                         requirePermission=false/>

   </configSections> 

  1. add Connection strings section

<connectionStrings>
<add name=NorthWind               connectionString=Server=yourserverName;Database=dbName;UID=youruserName;PWD=yourPassword;/>

   </connectionStrings> 

  1. add Subsonic service provider

<SubSonicService defaultProvider=NorthWind>
            <providers>
                  <clear/>
                  <add name=NorthWind
                         type=SubSonic.SqlDataProvider, SubSonic
                         connectionStringName=NorthWind
                         generatedNamespace=NorthWind  />
            </providers>
   </SubSonicService>

  1. Goto Bin folder of NorthWindDAL project and give reference to ‘SubSonic.dll’ available at “Program Files\SubSonic\SubSonic 2.1 Beta 2\SubSonic”
  2. and add reference to System.Web and System.Configuration

IV. Adding SubSonic Commander as external tool in Visual studio

Now you are ready for generate code.

When you click on External tool ‘SubSonicDAL’ , it generates code in specified folder that is ‘NorthWind’

That’s it…..  so simple

Posted by in 11:45:46 | Permalink | No Comments »