共用方式為


Getting Started: Creating a project

[This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation]

Creating a project

Microsoft Visual Studio is to Windows as Xcode is to iOS and Mac OS. In this walkthrough, we help you get comfortable using Visual Studio. It shows you the absolute basics you'll need to know to get started. Each time you create an app, you'll follow steps similar to these.

The following video compares Xcode and Visual Studio.

Creating a Windows Store app is rather like creating an iOS app using Storyboard. The Windows Store app is often constructed over several pages, each page containing a different part of the user interface, like a web site. Each page has two associated source files: one to store the user interface defined using XAML, and one which contains the source code. As your user interacts with your app, they will navigate between these pages. In this walkthrough, you will create an app with two pages.

Begin by running Microsoft Visual Studio 2013. The first time you run it, Visual Studio will ask you to get a developer license. A developer license lets you install and test Windows Store apps on your local computer before you submit them to the Windows Store. To get a license, follow the on-screen directions to sign in with a Microsoft account. If you don't have one, click the Sign up link in the Developer License dialog box, and follow the on-screen directions.

For comparison, when you start Xcode, the first thing you see is the Welcome to Xcode screen, similar to the following figure.

Visual Studio is very similar. You'll see the Start Page, as shown in the following figure.

To create a new app, start by making a project by doing one of the following:

  • In the Start area, tap New Project.
  • Tap the File menu, and then tap New Project.

For comparison, when you create a new project in Xcode, you see a list of project templates like those shown in the following figure.

In Visual Studio, there are also several project templates to choose from, as shown in the following figure.

Note  Microsoft Visual Studio 2013 Update 2 introduces Universal Windows apps. These are apps that allow a single solution to contain both Windows 8.1 and Windows Phone 8.1 projects, along with (optional) shared code and resources. Universal apps make it straightforward to develop for both device families simultaneously. Compare the process to building an app for both iPhone and iPad: with Universal iOS apps, you use the same code and same resources within your single Xcode project, and then check against UI_USER_INTERFACE_IDIOM at runtime, and use compile-time naming conventions to make resources unique to each device type. The Windows approach is a little different, and instead builds two separate executable files from a code base drawn from shared and unique files. In practice this means you will use a mix of shared and platform-specific source files at compile-time, rather than test at run-time. For more info, see Building Universal Windows apps for all Windows devices and Using Visual Studio to Build XAML Converged Apps.

 

For this walkthrough, tap Visual C#, and then tap Store Apps, Universal Apps and Blank App (Universal Apps). In the Name box, type "MyApp", and then tap OK. Visual Studio creates and then displays your first project. Now you can begin to design your app and add code to it.

Next step

Getting started: Choosing a programming language