Chapter 5: Creating and Building Projects

119

to all projects. The following sections describe each of the features of the Application settings tab.

Assembly Name

VS projects create either *.dll or *.exe assemblies. The assembly name provides the filename for this project and defaults to the name of your project. From Figure 5-3, you can see that Assembly Name is set to ProjectDemo. Since this is a Console application, the output would be a *.exe. It follows that the filename would be ProjectDemo.exe. Had the project type been a Class Library, the filename would have been ProjectDemo.dll.

Default Namespace

The Default namespace (Root namespace in VB) setting determines what the namespace will be defined automatically as whenever you add a new code file to your project. It’s initially set to the name of your project. If you want the namespace of new files to be different, set the namespace here.

Target Framework

VS has .NET Framework multitargeting support, where you can work with any version of

.NET between v2.0 and v4.0. Select the .NET version you need in the Target Framework combo box. VB includes this option on the Compile tab when clicking the Advanced Compile Options button. Remember to set the VB project from .NET Framework 4.0 Client Profile to .NET Framework 4.0 because later we’ll be referencing a class library that is set to .NET Framework 4.0 and the target frameworks must be compatible for one assembly to reference another.

Since you can have multiple versions of .NET on the same machine as VS 2010, you can switch freely between different projects that use different .NET versions. This is particularly useful if you’re a consultant working on different projects with different versions or if you’re providing maintenance support on older versions of a product while doing active development work in a different project using .NET 4.0.

Output Type

An Output type (Application type in VB) is the type of assembly created when you build your project. The three types of output are Windows Application, Console Application, and Class Library. You already know how to create a Console application, which produces a *.exe assembly. Later in this chapter, you’ll learn how to create a Class Library project, which produces a *.dll assembly. In Chapter 8, you’ll learn how to create a Windows Application project, which is a *.exe.

Page 142
Image 142
Microsoft 9GD00001 manual Assembly Name, Default Namespace, Target Framework, Output Type, 119