120Microsoft Visual Studio 2010: A Beginner’s Guide

TIP

If you have a WPF project, its Output Type is set to Windows Application. If you switched the Output Type of a WPF application to Console Application, you would see the Console window appear also. This might be useful for some intermediate debugging where you could emit Console.WriteLine messages. Of course, VS provides excellent debugging tools, which you’ll learn about in Chapter 6, including an Output window, but this is just another option if you ever wanted it.

Startup Object

You could add multiple Main methods to a Console application or a WPF application, but only one Main method can be active at a time. The Startup object allows you to specify which class contains the Main method you want to use as the entry point to your application. One of the reasons you might want to do this is to start your application in different configurations, which might facilitate testing by allowing you to go straight to a part of the program without too much navigation.

Icon and Manifest

By clicking the ellipses button on the right of the icon drop-down list, you can browse to an icon file, *.ico, that will appear as your application icon.

TIP

VS ships with system icons that you can use in your own applications. Navigate to C:\ Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033 and you’ll see a Zip file named VS2010ImageLibrary. Your path might be different if you chose to install VS2010 somewhere other than the default. Unzip this VS2010ImageLibrary and you’ll see a plethora of resources with images, audio, animations, and icons that are common to Microsoft operating systems and applications.

The manifest allows you to specify Microsoft Windows User Access Control (UAC) settings or to support a form of deployment called Click-Once, where a WPF application can be deployed from a Web page and run locally on your desktop machine. The manifest describes the application and deployment features of your Click-Once application. Since these manifests are automatically generated when you publish a Click-Once application, you normally won’t ever manually build manifest files yourself; this is considered

an advanced practice and includes knowledge beyond what a beginner’s guide would include.

In VB, there is a UAC Settings button that allows you to directly modify the app

.manifest file. This is an advanced technique that requires knowledge of the operating system UAC settings.

Page 143
Image 143
Microsoft 9GD00001 manual Startup Object, Icon and Manifest