Datasheet
8
Chapter 1: A Framework for Enterprise Applications
The Visual Studio solution for the application created in this book consists of an ASP.NET web appli-
cation, a class library application for the business logic layer, a class library application for the data
layer, and a control library for the custom controls. I also include the Microsoft Exception Handling
Application Block, but you could just reference the dlls, rather than the project files.
The fictitious company’s name is “Powered By V2.” It is a good idea to create all your projects with a
namespace that designates your company name in the beginning of the namespace. For this solution,
all namespaces will begin with “V2.” Follow these steps to build the Visual Studio solution that will be
used throughout the rest of this book:
1. Start Visual Studio 2008 and select File ➪ New Project from the menu.
2. Expand the Other Project Types item and click Visual Studio Solutions.
3. Enter PaidTimeOffSolution for the solution name.
4. Enter the location where you want the solution folder to be created in the Location box and click
the OK button. By default, this is under the My Documents\Visual Studio 2008\Projects folder.
An empty solution is created.
This solution will contain the ASP.NET web application and the class libraries that will be used to
implement the Paid Time Off application. Visual Studio 2008 enables you to create a file-based website
that uses its own built-in web server, but I used IIS for development because that is the environment
where the application will be deployed. I want my development environment to mimic production as
much as possible. If you were to add a website project to your solution at this point using http for the
location, you would end up with a folder under the
Inetpub/wwwroot folder. What you really want is
for the folder and virtual directory to be created in the solution folder. To do this you first have to create
the folder using Windows Explorer:
1. Navigate to the solution folder and create a folder called PaidTimeOffUI.
2. Launch IIS and create a virtual directory that points to this new folder and name it the same. In
Visual Studio 2008, right-click on the
PaidTimeOff solution in the Solution Explorer and select
Add New WebSite, select ASP.NET Web Site, and change the location to http.
3. Click the Browse button and select Local IIS from the Choose Location dialog box. The virtual
directory you just added should appear in the list.
4. Select the PaidTimeOffUI virtual directory and click the Open button. Make sure Visual C#
is selected for the language and then click the OK button. This will add the
Default.aspx,
Default.aspx.cs, and web.config files and the AppData folder to the PaidTimeOffUI folder.
Now you can add the business logic layer project and the data access layer project to the solution just
created:
1. Right-click on the PaidTimeOffSolution solution again and select Add New Project.
2. Select Class Library from the C# project types.
3. Enter V2.PaidTimeOffBLL for the project name. The location should be pointed to the solution
folder.
4. Click OK. This will create a folder in the PaidTimeOffSolution folder for the BLL project and
add the default project files to that folder.
96865c01.indd 8 12/17/08 2:06:04 PM