|
@ -17,7 +17,7 @@ Getting Started with ASP.NET Web API 2 (C#)
|
|||
====================
|
||||
by [Mike Wasson](https://github.com/MikeWasson)
|
||||
|
||||
[Download Completed Project](http://code.msdn.microsoft.com/ASP-NET-Web-API-Tutorial-8d2588b1)
|
||||
[Download Completed Project](https://code.msdn.microsoft.com/Sample-code-of-Getting-c56ccb28)
|
||||
|
||||
> HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can think of has an HTTP library, so HTTP services can reach a broad range of clients, including browsers, mobile devices, and traditional desktop applications.
|
||||
>
|
||||
|
@ -26,7 +26,7 @@ by [Mike Wasson](https://github.com/MikeWasson)
|
|||
> ## Software versions used in the tutorial
|
||||
>
|
||||
>
|
||||
> - [Visual Studio 2013](https://www.microsoft.com/visualstudio/eng/2013-downloads)
|
||||
> - [Visual Studio 2017](https://www.visualstudio.com/downloads/)
|
||||
> - Web API 2
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 66 KiB |
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
title: Choose between ASP.NET and ASP.NET Core
|
||||
author: rick-anderson
|
||||
description: "How to choose between ASP.NET and ASP.NET Core."
|
||||
description: How to choose between ASP.NET and ASP.NET Core.
|
||||
ms.author: aspnetcontent
|
||||
manager: wpickett
|
||||
ms.date: 06/07/2017
|
||||
ms.date: 07/21/2017
|
||||
ms.topic: article
|
||||
ms.assetid: f0d17abf-3c69-413e-87fc-30780805e33f
|
||||
ms.technology: aspnet
|
||||
|
@ -19,28 +19,27 @@ No matter the web application you are creating, ASP.NET has a solution for you:
|
|||
|
||||
## ASP.NET Core
|
||||
|
||||
ASP.NET Core is a new open-source and cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
|
||||
ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based web applications on Windows, macOS, or Linux.
|
||||
|
||||
## ASP.NET
|
||||
|
||||
ASP.NET is a mature web platform that provides all the services that you require to build enterprise-class, server-based web applications using .NET on Windows.
|
||||
ASP.NET is a mature framework that provides all the services needed to build enterprise-class, server-based web applications on Windows.
|
||||
|
||||
## Which one is right for me?
|
||||
|
||||
| ASP.NET Core | ASP.NET |
|
||||
|---|---|
|
||||
|Build for Windows, Mac, or Linux|Build for Windows|
|
||||
|Use [MVC](mvc/overview.md) or [Web API](tutorials/first-web-api.md)|Use [Web Forms](https://docs.microsoft.com/aspnet/web-forms), [SignalR](https://docs.microsoft.com/aspnet/signalr), [MVC](https://docs.microsoft.com/aspnet/mvc), [Web API](https://docs.microsoft.com/aspnet/web-api/), or [Web Pages](https://docs.microsoft.com/aspnet/web-pages)|
|
||||
|Build for Windows, macOS, or Linux|Build for Windows|
|
||||
|Use [MVC](xref:mvc/overview) or [Web API](xref:tutorials/first-web-api)|Use [Web Forms](https://docs.microsoft.com/aspnet/web-forms), [SignalR](https://docs.microsoft.com/aspnet/signalr), [MVC](https://docs.microsoft.com/aspnet/mvc), [Web API](https://docs.microsoft.com/aspnet/web-api/), or [Web Pages](https://docs.microsoft.com/aspnet/web-pages)|
|
||||
|Multiple versions per machine|One version per machine|
|
||||
|Develop with Visual Studio or Visual Studio Code using C#|Develop with Visual Studio using C#, VB or F#|
|
||||
|New platform|Mature platform|
|
||||
|Ultra performance|High performance|
|
||||
|Develop with Visual Studio, [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/), or [Visual Studio Code](https://code.visualstudio.com/) using C# or F#|Develop with Visual Studio using C#, VB, or F#|
|
||||
|Higher performance than ASP.NET|Good performance|
|
||||
|[Choose .NET Framework or .NET Core runtime](https://docs.microsoft.com/dotnet/articles/standard/choosing-core-framework-server)|Use .NET Framework runtime|
|
||||
|
||||
## ASP.NET Core scenarios
|
||||
|
||||
* [Websites](https://docs.microsoft.com/aspnet/core/tutorials/first-mvc-app/)
|
||||
* [APIs](https://docs.microsoft.com/aspnet/core/tutorials/first-web-api)
|
||||
* [Websites](xref:tutorials/first-mvc-app/index)
|
||||
* [APIs](xref:tutorials/first-web-api)
|
||||
|
||||
## ASP.NET scenarios
|
||||
|
||||
|
@ -51,4 +50,4 @@ ASP.NET is a mature web platform that provides all the services that you require
|
|||
## Resources
|
||||
|
||||
* [Introduction to ASP.NET](https://docs.microsoft.com/aspnet/overview)
|
||||
* [Introduction to ASP.NET Core](index.md)
|
||||
* [Introduction to ASP.NET Core](xref:index)
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
---
|
||||
title: Enforcing SSL in an ASP.NET Core app
|
||||
author: rick-anderson
|
||||
description: Shows how to require SSL in a web app and how to set IIS Express to use SSL
|
||||
description: Shows how to require SSL in a ASP.NET Core web app
|
||||
keywords: ASP.NET Core, SSL, HTTPS, RequireHttpsAttribute, IIS Express
|
||||
ms.author: riande
|
||||
manager: wpickett
|
||||
ms.date: 03/19/2017
|
||||
ms.date: 07/19/2017
|
||||
ms.topic: article
|
||||
ms.assetid: 4694e563-e91a-4ecd-b7ed-00b3f1eee2b5
|
||||
ms.technology: aspnet
|
||||
ms.prod: asp.net-core
|
||||
uid: security/enforcing-ssl
|
||||
|
@ -20,7 +19,6 @@ This document shows how to:
|
|||
|
||||
- Require SSL for all requests (HTTPS requests only).
|
||||
- Redirect all HTTP requests to HTTPS.
|
||||
- Set up IIS Express to use SSL/HTTPS.
|
||||
|
||||
## Require SSL
|
||||
|
||||
|
@ -40,9 +38,4 @@ Requiring HTTPS globally (`options.Filters.Add(new RequireHttpsAttribute());`) i
|
|||
|
||||
## Set up IIS Express for SSL/HTTPS
|
||||
|
||||
* In Solution Explorer, right click the project and select **Properties**.
|
||||
* On the left pane, select **Debug**.
|
||||
* Check **Enable SSL**
|
||||
* Copy the SSL URL and paste it into the **App URL**
|
||||
|
||||
![Debug tab of web application properties](enforcing-ssl/_static/ssl.png)
|
||||
See [Setting up HTTPS for development in ASP.NET Core](xref:security/https#iisxpress).
|
||||
|
|
|
@ -19,27 +19,17 @@ uid: security/https
|
|||
|
||||
You can configure your application to use HTTPS during development to simulate HTTPS in your production environment. Enabling HTTPS may be required to enable integration with various identity providers (like [Azure AD](https://azure.microsoft.com/services/active-directory) and [Azure AD B2C](https://azure.microsoft.com/services/active-directory-b2c)).
|
||||
|
||||
<a name="iisxpress"></a>
|
||||
|
||||
On Windows if you’ve installed Visual Studio or IIS Express, the IIS Express Development Certificate will be in your LocalMachine certificate store. You can update your project properties in Visual Studio to use this certificate when running behind IIS Express.
|
||||
|
||||
* In Solution Explorer, right-click the project and select **Properties**.
|
||||
* On the left pane, select **Debug**.
|
||||
* Check **Enable SSL**
|
||||
* Copy the SSL URL and paste it into the **App URL**
|
||||
|
||||
![Debug tab of web application properties](enforcing-ssl/_static/ssl.png)
|
||||
|
||||
You can also configure Kestrel to listen over HTTPS by configuring an endpoint with the desired IP address, port, and certificate. The certificate can be configured inline, or in the top level `Certificates` section and then referenced by name:
|
||||
|
||||
```json
|
||||
{
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"LocalhostHttps": {
|
||||
"Address": "127.0.0.1",
|
||||
"Port": "43434",
|
||||
"Certificate": "HTTPS"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
For development you can use the IIS Express Development Certificate if it is available, or create a new certificate for development purposes. The development certificate should be configured in the `appsettings.Development.json` file so that it is not used in production:
|
||||
|
||||
```json
|
||||
|
@ -66,6 +56,27 @@ Export-Certificate -Cert $cert -FilePath cert.cer
|
|||
Import-Certificate -FilePath cert.cer -CertStoreLocation cert:/CurrentUser/Root
|
||||
```
|
||||
|
||||
<a name="OpenSSL"></a>
|
||||
|
||||
## Kestrel on macOS and Linux
|
||||
|
||||
You can configure Kestrel to listen over HTTPS by configuring an endpoint with the desired IP address, port, and certificate. The certificate can be configured inline, or in the top-level `Certificates` section and then referenced by name:
|
||||
|
||||
```json
|
||||
{
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"LocalhostHttps": {
|
||||
"Address": "127.0.0.1",
|
||||
"Port": "43434",
|
||||
"Certificate": "HTTPS"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
On macOS and Linux you can create a self-signed certificate for HTTPS using [OpenSSL](https://www.openssl.org/):
|
||||
|
||||
```bash
|
||||
|
|
|
@ -5,9 +5,8 @@ description: A list of step-by-step guides for learning how to develop ASP.NET C
|
|||
keywords: ASP.NET Core,
|
||||
ms.author: tdykstra
|
||||
manager: wpickett
|
||||
ms.date: 10/14/2016
|
||||
ms.date: 7/14/2017
|
||||
ms.topic: get-started-article
|
||||
ms.assetid: a5313c5c-fdee-4ec6-9920-d94de5746e9b
|
||||
ms.technology: aspnet
|
||||
ms.prod: asp.net-core
|
||||
uid: tutorials/index
|
||||
|
@ -18,6 +17,9 @@ The following step-by-step guides for developing ASP.NET Core applications are a
|
|||
|
||||
## Building web applications
|
||||
|
||||
[Razor Pages](xref:mvc/razor-pages/index) is the recommended approach to create a Web UI with ASP.NET Core 2.0.
|
||||
|
||||
* [Introduction to Razor Pages in ASP.NET Core](xref:mvc/razor-pages/index)
|
||||
* [Create an ASP.NET Core app with Visual Studio for Mac](xref:tutorials/first-mvc-app-mac/start-mvc)
|
||||
* [Create an ASP.NET Core app with Visual Studio on Windows](first-mvc-app/index.md)
|
||||
* [Create an ASP.NET Core app with Visual Studio Code on Mac or Linux ](first-mvc-app-xplat/index.md)
|
||||
|
|