Visual Studio 2005 for .NET Framework 3.0


By default, Visual Studio 2005 doesn’t allow you to build applications that are targeted at the .NET Framework 3.0. The default install of Visual Studio 2005 is only targeted at the .NET Framework 2.0. To start working with the new technologies targeted at the .NET Framework 3.0, you are going to have to do a few extra installs.

The .NET Framework 3.0 provides you with access to a class library for building new application types such as applications that make use of the Windows Presentation Foundation (WPF), the Windows Communication Foundation (WCF), the Windows Workflow Foundation (WF), and Windows CardSpace.

To build any of these application types, you are first going to need to install the .NET Framework 3.0. The installation of the .NET Framework 3.0 will also install the .NET Framework 2.0 (for which it is dependent) on your machine as well if it is already not present. After the installation of the .NET Framework 3.0, you will then see this version of the framework is available at C:\WINDOWS\Microsoft.NET\Framework.

You will notice that the .NET Framework 3.0 is not a complete revision of the entire .NET Framework as you might know it. For instance, you will not find 3.0 versions of the System.dll or the System.Web.dll. Instead, you will see that the same 2.0 version of the .NET Framework is installed and you will find folders for all three components which the .NET Framework 3.0 provides. The folders are titled Windows Communication Foundation, Windows Workflow Foundation, and WPF. If you are working from Windows Vista, you will find that the .NET Framework 3.0 is already installed with the default install of the OS.

If you are going to want to work with the WPF, WCF, or the WF from within Visual Studio, then you are going to also have to take some extra steps. At the time of this writing, on Microsoft’s MSDN Web site, you will find two products that help you with this cause - the Visual Studio 2005 extensions for the .NET Framework 3.0 (Windows Workflow Foundation) and the Visual Studio 2005 extensions for the .NET Framework 3.0 (WCF and WPF). It is expected that you will be required to upgrade to a newer version of Visual Studio (post 2005) when all is finalized with these extensions.

To install either of these extensions, you are going to need to have Visual Studio 2005 already installed on your machine. Once the extensions are installed, you will then notice that you have all the .NET Framework 3.0 specific project types available to you directly in Visual Studio.

Project Types Available for .NET 3.0

In the pre-Orcas release of Visual Studio, installing the Visual Studio extensions for the various .NET 3.0 components will give you various new project types. These project types allow you to build .NET applications that make use of these new technologies. When you opt to create a new project from Visual Studio, you will notice that two new categories have been installed. One category is called NET Framework 3.0 and the other new category is called Workflow. If you highlight the NET Framework 3.0 option, the projects at your disposal shown here in Figure 14-29.

image from book
Figure 14-29

From this figure, you can see that this section focuses on projects that work with the Windows Presentation Foundation and the Windows Communication Foundation. The projects available to you in this section are detailed in the following table.

Open table as spreadsheet

Project

Description

Windows Application (WPF)

A basic empty form that responds to events. Though the project type is similar to the Windows Application project type (Windows Forms), this Windows Application project type allows you to build a XAML-based smart client solution.

XAML Browser Application (WPF)

Quite similar to the Windows Application for WPF, this variant allows you to build a XAML-based application that is targeted at the browser.

Custom Control Library (WPF)

Allows you to create custom server controls that can be utilized in your .NET 3.0 applications. Using interop, it is also possible to utilize these controls within a traditional Windows Forms application.

WCF Service Library

Allows for the creation of a service library, or set of services that have endpoints controlled via XML configuration files.

In addition to these four project types, the Workflow section provides another set of new project types available to you. All of these project types are focused on the Windows Workflow Foundation (WF). The following table defines these new project types for you.

Open table as spreadsheet

Project

Description

Sequential Workflow Console Application

Allows you to create a console application that makes use of a sequential workflow.

Sequential Workflow Library

Allows you to create a class library that makes use of a sequential workflow.

Workflow Activity Library

Considered a building block of your libraries you build, you can build activities to incorporate into these items.

State Machine Workflow Console Application

Allows you to create a console application that makes use of a state machine workflow.

State Machine Workflow Library

Allows you to create a class library that makes use of a state machine workflow.

Empty Workflow Project

An empty project focused on workflow.

As you can see from the options provided to you via the Workflow section of projects, there are basically two types of projects: ones based upon a sequential workflow and one based upon a state machine workflow.

A sequential workflow is a workflow that follows a particular flow, for example you might have the workflow do step A, then step B, and if true in step C, move onto step E. On the other hand, a state machine workflow is an event-driven workflow. This means that there is no step A and then step B process involved. Instead, it is something like: if the file is accessed, then accomplish this step in the workflow. You will find the new .NET 3.0 projects quite new and in many cases revolutionary in what they will accomplish for you. You will find chapters on these new capabilities in other chapters of this book. Be sure to take a look at Chapter 31, “Windows Presentation Foundation”; Chapter 40, “Windows Communication Foundation”; and Chapter 41, “Windows Workflow Foundation.”

Building WPF Applications in Visual Studio

One good example of some of the big changes that the .NET Framework 3.0 brings to Visual Studio is the Windows Application (WPF) project type. Selecting this project type will create a Windows.xaml and Windows.xaml.cs file for you to work from. Everything that is created by default with this project type in the Solution Explorer is presented here in Figure 14-30.

image from book
Figure 14-30

Right away, the biggest change you will notice in Visual Studio is contained within the document window. The default view of the document window after creating this project is presented here in Figure 14-31.

image from book
Figure 14-31

The document window has two views - a design view and a XAML view. Making changes in the design view will make the appropriate changes in the XAML view, and vice versa. As with traditional Windows Forms applications, WPF applications also include the ability to use controls that are contained within Visual Studio’s toolbox. This new toolbox of controls is presented in Figure 14-32.

image from book
Figure 14-32

Building WF Applications in Visual Studio

Another dramatically different application style (when it comes to building the application from within Visual Studio) is the Windows Workflow application type. For an example of this, select the Sequential Workflow Console Application project type from the Workflow section of the New Project dialog. This will create a console application as illustrated here with a view of the Solution Explorer (see Figure 14-33).

image from book
Figure 14-33

One big change you see when building applications that make use of the Windows Workflow Foundation is that there is a heavy dependency on the design view. Looking closely at the workflow (see Figure 14-34), you can see that it is made up of multiple sequential steps and even includes actions based upon conditions (such as an if-else statement).

image from book
Figure 14-34




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net