Installing and upgrading

The CSLA templates aren't installed with CodeSmith Generator. Download them from GitHub, or install them from NuGet. Then, to get started, run the QuickStart template.

Page What it covers
Downloading the CSLA templates Download the templates, sample applications and source code from GitHub.
Install a download Install templates you downloaded.
Install from NuGet Add the templates to a Visual Studio project with NuGet.
Upgrading the CSLA templates Move an existing solution to a newer version of the templates or of CSLA.

Important

Check your solution and templates into source control, or make a backup, before you install a different version of the templates.

Install a download

  1. Download CSLA-4.1-Beta.zip from the CSLA 4.1 Beta release on GitHub.
  2. Follow the steps in Upgrading CodeSmith Generator templates for templates downloaded from the internet.
  3. Extract the downloaded templates to one of these:
    • a folder of their own under Documents\CodeSmith Generator\Templates, the folder that Template Explorer shows as My Templates, for example Documents\CodeSmith Generator\Templates\Csla,
    • any other folder on a local (not networked) drive, or
    • the folder of your current CSLA templates, overwriting them.
  4. Run the QuickStart template to get up and running. If you're upgrading an existing solution, follow Upgrading the CSLA templates instead.

Install from NuGet

The CodeSmith.Generator.CSLA NuGet package adds the templates to a Visual Studio project. You need an internet connection and Visual Studio with NuGet.

  1. Install the package in a new or existing C# or Visual Basic project:

    1. Open the Package Manager Console.

    2. Run this command:

      Install-Package CodeSmith.Generator.CSLA
      
  2. Configure the Entities.csp Generator project file that the package adds:

    1. Right-click Entities.csp and select Manage Outputs.
    2. Double-click the Entities.cst output, or right-click it and select Edit Output.
    3. Choose what to generate from: click the ... button of the SourceDatabase property and select your database.
    4. Click OK to save the properties.
  3. Right-click Entities.csp and select Generate.