ASP.NET Core

Install ASP.NET Core and TypeScript

First, install ASP.NET Core if you need it. This quick-start guide requires Visual Studio 2015 or 2017.

Next, if your version of Visual Studio does not already have the latest TypeScript, you can install it.

Create a new project

  1. Choose File
  2. Choose New Project (Ctrl + Shift + N)
  3. Search for .NET Core in the project search bar
  4. Select ASP.NET Core Web Application and press the Next button

Visual Studio Project Window Screenshot

  1. Name your project and solution. After select the Create button

Visual Studio New Project Window Screenshot

  1. In the last window, select the Empty template and press the Create button

Visual Studio Web Application Screenshot

Run the application and make sure that it works.

A screenshot of Edge showing "Hello World" as success

Set up the server

Open Dependencies > Manage NuGet Packages > Browse. Search and install Microsoft.AspNetCore.StaticFiles and Microsoft.TypeScript.MSBuild:

The Visual Studio search for Nuget

Open up your Startup.cs file and edit your Configure function to look like this:

public void Configure(IApplicationBuilder app, IHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }

    app.UseDefaultFiles();
    app.UseStaticFiles();
}
Yes

© 2012-2021 Microsoft
Licensed under the Apache License, Version 2.0.
https://www.typescriptlang.org/docs/handbook/asp-net-core.html