Вы находитесь на странице: 1из 5
CHAPTER 2 Visual Studio 2008 and C# Express 2008 In Chapter 1, you learned that you can create your C# applications using Notepad In this chapter, you'll leam why you never will. Microsoft developed Visual Seudic 2008 to facilitate the creation of Windows and web applications. You will find that this integrated development environment (IDE) is a very powerful tool that will greatly simplify your work Visual Studio 2008 offers many advantages to the \NET developer, among them + A modem interface, using a tabbed document metaphor for code and layout sereens, and dockable toolbars and information windows. + Convenient access to multiple design and code windows (this will make more sense when you are creating web applications, as shown in Chapter 20) + WYSIWYG (What You See Is What You Get) visual design of Windows and Web Forms. + Code completion, which allows you to enter code with fewer errors and less typing + InteliSense, which displays tips for every method, providing the retum eype and the types of all the parameters + Dynamic, context sensitive help, which allows you to view topics and samples relevant to the code you are writing at the moment. You can also search che complete SDK hibrary from within the IDE, + Immediate flagging of syntax errors, which allows you to fix problems as they are entered + A Start Page, which provides easy access to new and existing projects + The same code editor for all .NE languages, which shortens the learning curve Each language can have specialized aspects, but all languages benefit from shared features, such as incremental search, code outlining, collapsing text, line ‘numbering, and color-coded keywords » + An HTML editor, which provides both Design and HTML views thae update cach other in real time + A Solution Explorer, wi outline form, + An integrated debugger, which allows you to step through code, observe pro gram runtime behavior, and set breakpoints, even across multiple languages and multiple processes. + Customization capability, which allows you to set user preferences for IDE appearance and behavior. + Integrated support for source control software ich displays all the files thar make up your solusion in + A builein cask lise + The ability to modify your controls’ properties, either declaratively or through the Properties window + The ability to integrate custom controls that you create or purchase from a third party. + Rapid and easy deployment, including che ability to copy an entire website development project irom one machine to another + The abiliey to integrate third-party tools into Visual Studio + ‘The ability to program extensions to Visual Studio + The ability to rename methods, properties, and so forth and have them renamed automatically throughout the program + A Server Explorer, which allows you to log on to servers that you have network access t0, access the data and services on those servers, drag-and-drop data sources onto controls, and perform a varity of other chores + Integrated build and compile support + The ability to dragand-drop controls onto your web page, either in Design mode or in HTML mode Visual Seudio 2008 and Visual C# 2008 Express are highly useful tools chat can save you hours of repetitive tasks. They are also large and complex programs, 80 it is impossible for us to explore every nook and cranny in this chapter. Instead, we'll take you on a quick tour of the interface and lay the foundation for understanding and using C# Express, which is our IDE of choice for this book, a well as poine out some of the nastier traps you might run into along the way [PE] Just about every feature we describe in this chapter can also be found 4g g., 2 Vial Stucio 2008. If there are any signiticant differences, we'll 84s point them our specifically, but for the most part, you can treat the * wo IDEs as identical Vswl Studio 2006 and Ce xpress2008 | 21 Before You Read Further This chapter has a lot of information init, and you won't need all ofall at once. In fact, much of the information will not even apply to console applications, bue will be valuable when you are ready to create Windows or web applications Many readers like to skim this chapter the first time through, and then come back for the details later. Bue itis your book, you paid for ie (you did pay for it, didn’t you?) and so you are free to read che entire chapter, take notes as you go, skipit entirely, or otherwise use it to your best advantage Whether or not you read this chapter, we do strongly recommend that you spend time (lots and lots of time) exploring C# Express in detail. You will forever be sur- prised at how much is in there and how much you ean set it up to behave as you want; it is your principal development tool. Ignoring C# Express would be like a race car driver never looking under the hood. In time, you not only wane to know how to change the oil, but also want to understand how the valves work and why the linkage sticks. The Start Page The Start Page isthe firs thing you see when you open C# Express (unless you config Lure it otherwise). From here, you can create new projects or open a project you worked on in a previous session, You can also find out what is new in NET, access NET newsgroups and website, search for help online, download useful code, or adjust C# Express to your personal requirements. Figure 2-1 shows a typical Stare Page, which you already saw briefly in Chapter 1 The Stare Page has a window on the let chat includes a list of your recent projects you can click on any one t0 open it. Below those links, you'll find che Open link. ‘which les you open any existing project on your computer. Under that is the Create link, which lets you create a new project. The Getting Started box on the lower let provides links o features and helpful sites. Mose ofthe real estate on the Stare Page is, taken up by the large box in the middle, which coneains useful articles from MSDN online, if you have an active Internet connection Projects and Solutions A C# program is built from source files, which are text files containing the code you write, Source code files are named with the .cs extension, The Program.cs file you created in Chapter 1 isan example A typical C# Express 2008 application can have a number of other files (such as assembly information files, references, icons, data connections, and more). C# Express 2008 organizes these files into a container called a project 2 [” Ghapter2 Visual Studio 2008 and Gr xpress 2008 Figure 2-1. The GH Express Start Page isthe fast thing you'll see when you start GH Express. From here, tere are many different links to get you started C# Express 2008 provides wo types of containers for your source code, folders, files, and related material: the project and the solution. A project is a set of files that work together to create an executable program (ex) oF a dynamic link library (all. Large, complex projects may contain muleiple files. A solution isa set of related projects, although it may also have just one project— which is what youll do most often in this book, Bach time you create a new project, C# Express 2008 either adds it to an existing solution or creates a new solution. Solutions are defined within a file named for the solution, and they have the exten sion sln.‘The sin file contains metadata, which is basically information about the data. The metadata describes the projects that compose the solusion and informa tion about building the solution. You won't have to worry about these for the most part Visual Studio 2008 also creates a file with the same base name as the 4S ag... Sle, but with the filename extension sow (such as mySolution tn and mySoluton ow. The:sou file contains metadata used to custon ize the IDE forthe specific user Projedsand Solutions [23 This document was created with Win2PDF available at http:/www.win2paf.com, The unregistered version of Win2PDF is for evaluation or non-commercial use only. This page will not be added after purchasing Win2PDF.

Вам также может понравиться