How to do it...

  1. Open Visual Studio 2017.
  2. Click File | New | Project and select Web in the right-hand pane under Visual C#
  3. Select ASP.NET Core Web Application in the right-hand pane:
  1. Now, in the Name: textbox, type Chapter12.Azure.WebAppCore, and, under the Location: textbox, select a proper location and leave the other fields as they are:
  1. Click OK.
  1. In the New ASP.NET Core Web Application dialog box, select Empty and leave the other fields as they are:
  1. Click OK.
  2. The Solution Explorer (Ctrl + Alt + L) should look like this:
  1. Now, right-click on the Dependencies label.
  2. Select Manage NuGet Packages.
  3. Click Browse and, in the search box, type the Package ID you have selected while uploading.
  4. In this case, Packt_DotNetStandard_CookBook_Chap1, and press Enter:
  1. Now, click on the package.
  2. Click the Install button in the right-hand pane:
  1. Click OK in the confirmation dialog box.
  1. After a successful installation, the output window should look like this:
  1. Now, in the Solution Explorer, expand the Dependencies | NuGet  tab and you should see our library there:
  1. Now, double-click on the Startup.cs button to reach the code window.
  2. Scroll up till you see the using directives.
  3. Add the following directive at the end of the using directives:
      using Chapter11.Packaging.CalcLib;
  1. Now, scroll down till you reach the app.Run() method inside the Configure() method.
  2. Replace the code with this:
      var calculator = new Calculator();
var answer = calculator.Add(10, 50);

await context.Response.WriteAsync($"Answer for 10+50
is {answer}");
  1. Press F5 to debug.
  2. You should get an output like this:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.108.11