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
- Download
CSLA-4.1-Beta.zipfrom the CSLA 4.1 Beta release on GitHub. - Follow the steps in Upgrading CodeSmith Generator templates for templates downloaded from the internet.
- 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 exampleDocuments\CodeSmith Generator\Templates\Csla, - any other folder on a local (not networked) drive, or
- the folder of your current CSLA templates, overwriting them.
- a folder of their own under
- 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.
-
Install the package in a new or existing C# or Visual Basic project:
-
Open the Package Manager Console.
-
Run this command:
Install-Package CodeSmith.Generator.CSLA
-
-
Configure the
Entities.cspGenerator project file that the package adds:- Right-click
Entities.cspand select Manage Outputs. - Double-click the Entities.cst output, or right-click it and select Edit Output.
- Choose what to generate from: click the ... button of the
SourceDatabaseproperty and select your database. - Click OK to save the properties.
- Right-click
-
Right-click
Entities.cspand select Generate.