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
- Choose File
- Choose New Project (Ctrl + Shift + N)
- Search for .NET Core in the project search bar
- Select ASP.NET Core Web Application and press the Next button
- Name your project and solution. After select the Create button
- In the last window, select the Empty template and press the Create button
Run the application and make sure that it works.
Set up the server
Open Dependencies > Manage NuGet Packages > Browse. Search and install Microsoft.AspNetCore.StaticFiles
and Microsoft.TypeScript.MSBuild
:
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