ASP.NET Core MVC 2.0 Cookbook
上QQ阅读APP看书,第一时间看更新

How to do it...

  1. First, let's create a new project by clicking New | Project | ASP.NET Core Web Application | Web application to create a web application running with ASP.NET Core:
When you run a web application in Visual Studio 2017, you have the choice to develop, debug, and deploy a web application in two different runtime versions, which have themselves two versions for the processor architecture as follows:
  • CLR x86 (.NET 4.6 in 32 bits, only for Windows)
  • CLR x64 (.NET 4.6 in 64 bits, only for Windows)
  • CoreCLR x86 (.NET Core in 32 bits, cross-platform)
  • CoreCLR x64 (.NET Core in 64 bits, cross-platform)
  1. Let's do our first deployment by creating a website on Azure. To do that, right-click on the root of the project and select Publish....
  2. The Publish Web dialog box will open:
  1. Click Microsoft Azure App Service. The Create App Service dialog box will open:
  1. We have to give an App Name.
  2. Select the Subscription.
  3. Select an App Service Plan, or create one.
  4. Select a Resource Group (optional).
  5. Select a Region (optional).
  6. Select or create a Database Server (optional).
  1. Now the Create button is enabled, we click on it:

In the preceding screenshot, we can see a preview of the deployed files.

  1. Click Publish:

In the preceding screenshot, we can see the result of the build and the publishing in the output window.

In the following screenshot, we can see how our web application deployed on Azure:

Take a look at the screenshot below. We can see the publish settings for the web application in the PublishProfiles folder as one .pubxml file.