You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: public/docs/ts/latest/cookbook/visual-studio-2015.jade
+80-73
Original file line number
Diff line number
Diff line change
@@ -5,63 +5,101 @@ include ../_util-fns
5
5
Some developers prefer Visual Studio as their Integrated Development Environment (IDE).
6
6
7
7
This cookbook describes the steps required to set up and use the
8
-
Angular QuickStart files in Visual Studio 2015 within an ASP.NET 4.x project.
9
-
8
+
Angular QuickStart files in **Visual Studio 2015 within an ASP.NET 4.x project**.
10
9
.l-sub-section
11
10
:marked
12
11
There is no *live example* for this cookbook because it describes Visual Studio, not the application.
12
+
13
13
.l-main-section
14
14
<aid="asp-net-4"></a>
15
15
:marked
16
16
## ASP.NET 4.x Project
17
-
18
-
The steps for setting up the QuickStart files with an ASP.NET 4.x project in
19
-
Visual Studio 2015 are as follows:
17
+
18
+
This cookbook explains how to set up the QuickStart files with an **ASP.NET 4.x project** in
19
+
Visual Studio 2015.
20
+
.l-sub-section
21
+
:marked
22
+
If you prefer a `File | New Project` experience and are using **ASP.NET Core**,
23
+
then consider the _experimental_
24
+
<a href="http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/" target="_blank">ASP.NET Core + Angular 2 template for Visual Studio 2015</a>.
25
+
Note that the resulting code does not map to the docs. Adjust accordingly.
20
26
21
27
:marked
22
-
- [Prerequisite](#prereq): Install Node.js
28
+
The steps are as follows:
29
+
30
+
- [Prerequisite](#prereq1): Install Node.js
31
+
- [Prerequisite](#prereq2): Install Visual Studio 2015 Update 3
32
+
- [Prerequisite](#prereq3): Configure External Web tools
33
+
- [Prerequisite](#prereq4): Install TypeScript 2 for Visual Studio 2015
23
34
- [Step 1](#download): Download the QuickStart files
24
-
- [Step 2](#setup-vs): Set up Visual Studio for TypeScript
25
-
- [Step 3](#create-project): Create the Visual Studio ASP.NET project
26
-
- [Step 4](#copy): Copy the QuickStart files into the ASP.NET project folder
27
-
- [Step 5](#restore): Restore required packages
28
-
- [Step 6](#edit-config): Edit the TypeScript configuration file
29
-
- [Step 7](#build-and-run): Build and run the app
35
+
- [Step 2](#create-project): Create the Visual Studio ASP.NET project
36
+
- [Step 3](#copy): Copy the QuickStart files into the ASP.NET project folder
37
+
- [Step 4](#restore): Restore required packages
38
+
- [Step 5](#build-and-run): Build and run the app
30
39
31
40
.l-main-section
32
-
h2#prereq Prerequisite: Node.js
41
+
h2#prereq1 Prerequisite: Node.js
33
42
:marked
34
43
Install **[Node.js® and npm](https://nodejs.org/en/download/)**
35
44
if they are not already on your machine.
36
45
.l-sub-section
37
46
:marked
38
-
**Verify that you are running node version `4.4.x` - `5.x.x`, and npm `3.x.x`**
47
+
**Verify that you are running node version `4.6.x` or greater, and npm `3.x.x` or greater**
39
48
by running `node -v` and `npm -v` in a terminal/console window.
40
49
Older versions produce errors.
41
50
42
51
.l-main-section
43
-
h2#download Step 1: Download the QuickStart files
52
+
h2#prereq2 Prerequisite: Visual Studio 2015 Update 3
44
53
:marked
45
-
[Download the QuickStart source](https://github.com/angular/quickstart)
46
-
from github. If you downloaded as a zip file, extract the files.
54
+
The minimum requirement for developing Angular 2 applications with Visual Studio is Update 3.
55
+
Earlier versions do not follow the best practices for developing applications with TypeScript.
56
+
To view your version of Visual Studio 2015, go to `Help | About Visual Studio`.
57
+
58
+
If you don't have it, install **[Visual Studio 2015 Update 3](https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs)**.
59
+
Or use `Tools | Extensions and Updates` to update to Update 3 directly from Visual Studio 2015.
47
60
48
61
.l-main-section
49
-
h2#setup-vs Step 2: Set up Visual Studio for TypeScript
62
+
h2#prereq3 Prerequisite: Configure External Web tools
50
63
:marked
51
-
Ensure you have the latest version of Visual Studio 2015 installed.
52
-
Then open Visual Studio and install the latest set of TypeScript tools as follows:
64
+
Configure Visual Studio to use the global external web tools instead of the tools that ship with Visual Studio:
53
65
54
-
* Open `Tools` | `Extensions and Updates`.
55
-
* Select `Online` in the tree on the left.
56
-
* Search for `TypeScript` using the search box in the upper right.
57
-
* Select the most current available TypeScript version.
58
-
* Download and install the package.
66
+
* Open the **Options** dialog with `Tools` | `Options`
67
+
* In the tree on the left, select `Projects and Solutions` | `External Web Tools`.
68
+
* On the right, move the `$(PATH)` entry above the `$(DevEnvDir`) entries. This tells Visual Studio to
69
+
use the external tools (such as npm) found in the global path before using its own version of the external tools.
70
+
* Click OK to close the dialog.
71
+
* Restart Visual Studio for this change to take effect.
72
+
73
+
Visual Studio will now look first for external tools in the current workspace and
74
+
if not found then look in the global path and if it is not found there, Visual Studio
75
+
will use its own versions of the tools.
59
76
60
77
.l-main-section
61
-
h2#create-project Step 3: Create the Visual Studio ASP.NET project
78
+
h2#prereq4 Prerequisite: Install TypeScript 2 for Visual Studio 2015
79
+
:marked
80
+
While Visual Studio Update 3 ships with TypeScript support out of the box, it currently doesn’t ship with TypeScript 2,
81
+
which you need to develop Angular 2 applications.
82
+
83
+
To install TypeScript 2:
84
+
* Download and install **[TypeScript 2.0 for Visual Studio 2015](http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS2.0.3-TS-release20-nightly-20160921.1/TypeScript_Dev14Full.exe)**
You can find out more about TypeScript 2 support in Visual studio **[here](https://blogs.msdn.microsoft.com/typescript/2016/09/22/announcing-typescript-2-0/)**
88
+
89
+
At this point, Visual Studio is ready. It’s a good idea to close Visual Studio and
90
+
restart it to make sure everything is clean.
62
91
92
+
.l-main-section
93
+
h2#download Step 1: Download the QuickStart files
63
94
:marked
64
-
Create the ASP.NET 4.x project as follows:
95
+
[Download the QuickStart source](https://github.com/angular/quickstart)
96
+
from github. If you downloaded as a zip file, extract the files.
97
+
98
+
.l-main-section
99
+
h2#create-project Step 2: Create the Visual Studio ASP.NET project
100
+
101
+
:marked
102
+
Create the ASP.NET 4.x project in the usual way as follows:
65
103
66
104
* In Visual Studio, select `File` | `New` | `Project` from the menu.
67
105
* In the template tree, select `Templates` | `Visual C#` (or `Visual Basic`) | `Web`.
@@ -74,7 +112,7 @@ h2#create-project Step 3: Create the Visual Studio ASP.NET project
74
112
no authentication and no hosting. Pick the template and options appropriate for your project.
75
113
76
114
.l-main-section
77
-
h2#copy Step 4: Copy the QuickStart files into the ASP.NET project folder
115
+
h2#copy Step 3: Copy the QuickStart files into the ASP.NET project folder
78
116
79
117
:marked
80
118
Copy the QuickStart files we downloaded from github into the folder containing the `.csproj` file.
@@ -90,7 +128,7 @@ h2#copy Step 4: Copy the QuickStart files into the ASP.NET project folder
90
128
* tsconfig.json
91
129
92
130
.l-main-section
93
-
h2#restore Step 5: Restore the required packages
131
+
h2#restore Step 4: Restore the required packages
94
132
:marked
95
133
Restore the packages required for an Angular application as follows:
0 commit comments