Join Walt Ritscher for an in-depth discussion in this video Creating a Visual Studio project, part of Visual Studio 2012 Essential Training.
In this movie, I'll spend a few minutes looking at how to create a basic Visual Studio project. Elsewhere in this series, I have details on creating the different kinds of project templates, and how to use the various tools in the application. My goal in this movie is to show what happens the first time you run Visual Studio, and how to create a basic project. Let's start Visual Studio. On my machine I'm using Windows 8. So, to start Visual Studio, I will go to the start menu by pressing the Window key on my keyboard. This is the Start menu.
In the Start menu, you can just start typing the item you're looking for. I'm looking for visual, so I'll type in visu. And then, I'll choose from this list. You can see there are a number of items that have the word visual in there. I'll choose this first one. Now, before I run this application, let me right-click on it and show you another thing you can do in Windows. At least in Windows 8. You can choose to pin this item to the task bar. I've already pinned it in an earlier rehearsal. So, I can unpin it here, and then repin it.
You can see, I can also do things like uninstall the application, open it in a new window and run as administrator. There are certain tasks that you can only do as an administrator. So, what you can do is you'd click on this. You'll have to enter your name and password here, and then click on Yes. Now, I'm running Visual Studio as a second user on this machine. You can see at the top of the screen, it says Microsoft Visual Studio, and then inside the parenthesis, Administrator. Notice that it doesn't my settings that I set up in the earlier video, my color scheme, and my no caps menu.
Let's close Visual Studio and try this again. I'll go to my Start screen, pressing the Window key, typing vis, clicking here. This time I did not run it as an administrator, so I'm using my normal account. Now, I'm ready to create a project, but before I do that I want to show you one other item that's installed with Visual Studio. There are a number of tools that are installed as part of the process and one of them is a special command prompt. So, I'm going to press the Window key on my keyboard, type in cmd for command. And then, I'm going to chose this one here, the Developer Command Prompt. What this gives me is a programmatic access to all of the tools like the compilers and the build engines and the disassembling tools that ship with Visual Studio 2012.
So, I can type on this command line, a name of one of these executables, like here's the C# compiler. And if I had the correct arguments passed into this command line tool, I could compile some source code into a finished executable. There are certain tasks which I use it for that you just can't do inside Visual Studio. Okay, enough of this, let's go back to Visual Studio. This is the starting screen in Visual Studio. On the left side of the screen are a number of hyperlinks for some standard actions. On this one, you can create a new project.
Here, you can open an existing project. You can connect to your Team Foundation Server. And then, at the bottom, you've got links to all the projects you've opened recently. These are some of the projects I created during my Windows Store app title a few months back. I'm going to choose new project. Now, I get to pick my language and my project type. Here's the visual basic language, here's the C# language. Within the C# language there are different project types. I'm going to create a simple console application by choosing Windows, and then Console Application. Down here in the bottom part of the screen, you pick the name of your project, the location of where you're going to place those files, and a solution name.
More discussion about solutions coming up soon. I'll allow it to create a directory for my solution, and then I'll click OK. At this point, I have a project open inside Visual Studio. Here is my code editor. And on the right side of the screen is an area called the Solution Explorer. Here, you can see, I have a number of project files, program.cs, app.config, and so on. Each project type adds a set of files and settings that make sense for that type of application. To make an interesting application, I would need to open the C# file, and write some code in this area. Those topics are detailed in other movies.
What I'd like to show you now is how to create a project in one of the Express editions of Visual Studio. To do that, I'm going to press the Window key on my keyboard, type in express, and choose this shortcut. VS Express for desktop. This is one of the free editions of Visual Studio. It's optimized for building desktop type applications. So, you notice I have the same hyperlinks over here, New Project. I have a reduced subset of the project types.
I still have Visual Basic, and C# and some of the other languages. And I have a subset of the kinds of projects that I can create. Here, I can create only in Windows Form App, a WPF App, a Console App and two others. For variety, I'll choose this top one, Windows Forms Application. And then, click OK. Once again, you'll see an editor on the side of the screen. A Solution Explorer on the right side of the screen. A number of files from this project template including Form.cs, Form1.Designer.cs, Program.cs, and many more.
In summary, running Visual Studio is no different than running any other full-featured desktop application. It works in Windows 7 or Windows 8. Coming up in the next movie is the thrilling story on how to use the Solution Explorer which lives over here on the right edge of the screen.
- Creating a Visual Studio project
- Understanding the project types
- Working with the Toolbox and Properties windows
- Building a user interface with the editors
- Exploring tools that enhance your coding sessions
- Navigating and formatting your code
- Working with Expression Blend for complex UI
- Debugging code