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
Copy file name to clipboardExpand all lines: docs/documentation/zh/tutorials/ASP.NET Core.md
+73-73Lines changed: 73 additions & 73 deletions
Original file line number
Diff line number
Diff line change
@@ -2,43 +2,43 @@
2
2
title: ASP.NET Core
3
3
layout: docs
4
4
permalink: /zh/docs/handbook/asp-net-core.html
5
-
oneline: Using TypeScript in ASP.NET Core
5
+
oneline: 在 ASP.NET Core 中使用 TypeScript
6
6
---
7
7
8
-
## Install ASP.NET Core and TypeScript
8
+
## 安装 ASP.NET Core 和 TypeScript
9
9
10
-
First, install [ASP.NET Core](https://dotnet.microsoft.com/apps/aspnet) if you need it. This quick-start guide requires Visual Studio 2015 or 2017.
10
+
首先,如果需要,请先安装 [ASP.NET Core](https://dotnet.microsoft.com/apps/aspnet)。本快速入门指南需要 Visual Studio 2015 或 2017。
11
11
12
-
Next, if your version of Visual Studio does not already have the latest TypeScript, you can [install it](https://www.typescriptlang.org/index.html#download-links).
12
+
接下来,如果你的 Visual Studio 版本尚未包含最新的 TypeScript,你可以[安装它](https://www.typescriptlang.org/index.html#download-links)。
13
13
14
-
## Create a new project
14
+
## 创建新项目
15
15
16
-
1.Choose**File**
17
-
2.Choose**New Project** (Ctrl + Shift + N)
18
-
3.Search for **.NET Core** in the project search bar
19
-
4.Select**ASP.NET Core Web Application** and press the _Next_ button
16
+
1.选择**文件**
17
+
2.选择**新建项目**(Ctrl + Shift + N)
18
+
3.在项目搜索框中查找 **.NET Core**
19
+
4.选择**ASP.NET Core Web 应用程序**然后按*下一步*按钮
20
20
21
-

21
+

22
22
23
-
5.Name your project and solution. After select the _Create_ button
23
+
5.给你的项目和解决方案命名。然后选择*创建*按钮
24
24
25
-

25
+

26
26
27
-
6.In the last window, select the **Empty** template and press the _Create_ button
27
+
6.在最后一个窗口,选择**空**模板,然后按*创建*按钮
28
28
29
-

29
+

30
30
31
-
Run the application and make sure that it works.
31
+
运行应用程序,确保它能正常工作。
32
32
33
-

First we need to tell TypeScript how to build. Right click on `scripts`and click **New Item**. Then choose **TypeScript Configuration File** and use the default name of `tsconfig.json`
[`noImplicitAny`](/tsconfig#noImplicitAny)is good idea whenever you’re writing new code — you can make sure that you don’t write any untyped code by mistake. `"compileOnSave"` makes it easy to update your code in a running web app.
116
+
[`noImplicitAny`](/zh/tsconfig#noImplicitAny)是编写新代码时的一个好主意——你可以确保不会无意中编写任何未定类型的代码。通过 `"compileOnSave"`,你可以很容易地更新运行中的 web 应用程序的代码。
117
117
118
-
#### _Set up NPM_
118
+
#### _配置 NPM_
119
119
120
-
We need to setup NPM so that JavaScript packages can be downloaded. Right click on the project and select **New Item**. Then choose **NPM Configuration File** and use the default name of `package.json`.
@@ -164,19 +164,19 @@ gulp.task("default", function (done) {
164
164
});
165
165
```
166
166
167
-
The first line tells Visual Studio to run the task ‘default’ after the build finishes. It will also run the ‘clean’ task when you ask Visual Studio to clean the build.
167
+
第一行告诉 Visual Studio 在构建完成后运行‘default’任务。它还将在你要求 Visual Studio 清理构建时运行‘clean’任务。
168
168
169
-
Now right-click on `gulpfile.js`and click Task Runner Explorer.
169
+
现在右击 `gulpfile.js`并单击任务运行程序资源管理器。
170
170
171
-

Right click on the `wwwroot`folder (if you don't see the folder try building the project) and add a New Item named `index.html`inside. Use the following code for`index.html`
0 commit comments