Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 34a4685

Browse files
author
vomvoru
authored
Merge branch 'master' into patch-1
2 parents d543dfe + 03ee8dd commit 34a4685

File tree

5 files changed

+55
-17
lines changed

5 files changed

+55
-17
lines changed
Loading
Loading
Binary file not shown.

pages/tsconfig.json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Setting a top-level property `compileOnSave` signals to the IDE to generate all
199199
}
200200
```
201201

202-
This feature is currently supported in Visual Studio 2015 with TypeScript 1.8.4 and above, and [atom-typescript](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#compileonsave) plugin.
202+
This feature is currently supported in Visual Studio 2015 with TypeScript 1.8.4 and above, and [atom-typescript](https://github.com/TypeStrong/atom-typescript#compile-on-save) plugin.
203203

204204
## Schema
205205

pages/tutorials/ASP.NET Core.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# Setup
22

3-
> Note: Updates for Visual Studio 2017 and the latest version of ASP.NET coming soon!
4-
53
## Install ASP.NET Core and TypeScript
64

7-
First, [install ASP.NET Core](https://get.asp.net) if you need it.
8-
This quick-start guide uses Visual Studio, which means that you'll need Visual Studio 2015 in order to use ASP.NET Core.
5+
First, [install ASP.NET Core](https://get.asp.net) if you need it. This quick-start guide requires Visual Studio 2015 or 2017.
96

107
Next, if your version of Visual Studio does not already have the latest TypeScript, you can [install it](http://www.microsoft.com/en-us/download/details.aspx?id=48593).
118

@@ -14,19 +11,20 @@ Next, if your version of Visual Studio does not already have the latest TypeScri
1411
1. Choose **File**
1512
2. Choose **New Project** (Ctrl + Shift + N)
1613
3. Choose **Visual C#**
17-
4. Choose **ASP.NET Web Application**
14+
4. For VS2015, choose **ASP.NET Web Application** > **ASP.NET 5 Empty**, and let's uncheck "Host in the cloud" since we're going to run this locally.
1815

19-
![Create new ASP.NET project](../../assets/images/tutorials/aspnet/new-asp-project.png)
16+
![Use empty template](../../assets/images/tutorials/aspnet/new-asp-project-empty.png)
2017

21-
5. Choose **ASP.NET 5 Empty**
18+
For VS2017, choose **ASP.NET Core Web Application (.NET Core)** > **ASP.NET Core 1.1 Empty** instead.
2219

23-
Let's uncheck "Host in the cloud" since we're going to run this locally.
24-
![Use empty template](../../assets/images/tutorials/aspnet/new-asp-project-empty.png)
20+
![Use empty template VS2017](../../assets/images/tutorials/aspnet/new-asp-project-empty-17.PNG)
2521

2622
Run the application and make sure that it works.
2723

2824
## Set up the server
2925

26+
### VS2015
27+
3028
In `project.json` add another entry in `"dependencies"`:
3129

3230
```json
@@ -54,6 +52,24 @@ public void Configure(IApplicationBuilder app)
5452
}
5553
```
5654

55+
### VS2017
56+
57+
Open **Dependencies** > **Manage NuGet Packages** > **Browse**. Search and install `Microsoft.AspNetCore.StaticFiles` 1.1.2:
58+
59+
![Install Microsoft.AspNetCore.StaticFiles](../../assets/images/tutorials/aspnet/install-nuget-packages.png)
60+
61+
Replace the body of `Configure` in `Startup.cs` with
62+
63+
```cs
64+
public void Configure(IApplicationBuilder app)
65+
{
66+
app.UseDefaultFiles();
67+
app.UseStaticFiles();
68+
}
69+
```
70+
71+
You may need to restart VS for the red squiggly lines below `UseDefaultFiles` and `UseStaticFiles` to disappear.
72+
5773
# Add TypeScript
5874

5975
The next step is to add a folder for TypeScript.
@@ -205,7 +221,7 @@ Use the following code for `index.html`:
205221
## Debug
206222

207223
1. In Edge, press F12 and click the **Debugger** tab.
208-
2. Look in the first localhost folder, then src/app.ts
224+
2. Look in the first localhost folder, then scripts/app.ts
209225
3. Put a breakpoint on the line with `return`.
210226
4. Type in the boxes and confirm that the breakpoint hits in TypeScript code and that inspection works correctly.
211227

@@ -218,12 +234,30 @@ Next we'll include Angular and write a simple Angular app.
218234

219235
## Add NPM dependencies
220236

221-
Add the following `"dependencies"` to `package.json` to install Angular 2 and SystemJS:
237+
Add Angular 2 and SystemJS to `dependencies` in `package.json`.
238+
239+
For VS2015, the new `dependencies` list:
240+
241+
```json
242+
"dependencies": {
243+
"angular2": "2.0.0-beta.11",
244+
"systemjs": "0.19.24",
245+
"gulp": "3.9.0",
246+
"del": "2.2.0"
247+
},
248+
```
249+
250+
For VS2017, due to the deprecation of peer dependencies in NPM3, we need to list Angular 2's peer dependencies directly as dependencies as well:
222251

223252
```json
224253
"dependencies": {
225254
"angular2": "2.0.0-beta.11",
255+
"reflect-metadata": "0.1.2",
256+
"rxjs": "5.0.0-beta.2",
257+
"zone.js": "^0.6.4",
226258
"systemjs": "0.19.24",
259+
"gulp": "3.9.0",
260+
"del": "2.2.0"
227261
},
228262
```
229263

@@ -254,7 +288,7 @@ Our tsconfig should now look like this:
254288
"files": [
255289
"./app.ts",
256290
"./model.ts",
257-
"./main.ts",
291+
"./main.ts"
258292
],
259293
"compileOnSave": true
260294
}
@@ -290,15 +324,15 @@ var paths = {
290324
};
291325

292326
gulp.task('lib', function () {
293-
gulp.src(paths.libs).pipe(gulp.dest('wwwroot/scripts/lib'))
327+
gulp.src(paths.libs).pipe(gulp.dest('wwwroot/scripts/lib'));
294328
});
295329

296330
gulp.task('clean', function () {
297331
return del(['wwwroot/scripts/**/*']);
298332
});
299333

300334
gulp.task('default', ['lib'], function () {
301-
gulp.src(paths.scripts).pipe(gulp.dest('wwwroot/scripts'))
335+
gulp.src(paths.scripts).pipe(gulp.dest('wwwroot/scripts'));
302336
});
303337
```
304338

@@ -308,6 +342,8 @@ Again, make sure that Task Runner Explorer sees the new `lib` task after you sav
308342

309343
First, change the code in `app.ts` to:
310344

345+
{% raw %}
346+
311347
```ts
312348
import {Component} from "angular2/core"
313349
import {MyModel} from "./model"
@@ -324,15 +360,17 @@ export class MyApp {
324360
}
325361
```
326362

327-
Then add another TypeScript file in `src` named `model.ts`:
363+
{% endraw %}
364+
365+
Then add another TypeScript file in `scripts` named `model.ts`:
328366

329367
```ts
330368
export class MyModel {
331369
compiler = "TypeScript";
332370
}
333371
```
334372

335-
And then another TypeScript file in `src` named `main.ts`:
373+
And then another TypeScript file in `scripts` named `main.ts`:
336374

337375
```ts
338376
import {bootstrap} from "angular2/platform/browser";

0 commit comments

Comments
 (0)