Getting Started with ASP.net Core 1.0

Post on 16-Apr-2017

2.079 views 2 download

Transcript of Getting Started with ASP.net Core 1.0

Getting started with ASP.NET Core 1.0 (formerly ASP .NET 5)Joe RaioSenior Technical Evangelistjoe.raio@microsoft.com

• The ‘About Me’ Slide• Goals• .NET Core 1.0 General

Info• Demo Project & XPlat• Summary• Things to Know• Q&A at the End

Agenda

Joe RaioSenior Technical EvangelistDX AudienceJoe.Raio@Microsoft.comjoeraio.com@joescars

About Me: Based in Ft. Lauderdale, FL. Recently Married. I love Music, Aviation and all things Technology

What is a Microsoft Technical Evangelist?Our mission is not only to educate students, developers and startups on the latest Microsoft technologies, but also inspire them to do more by building amazing projects with the community.

• Developing Websites• Building Games• IoT• And much more…

Goals of Presentation• High level overview ASP.NET Core 1.0• Cross Platform Story• Working with ASP.NET Core in Visual

Studio (PC) & Visual Studio Code (MAC)• Connecting to the Cloud• Resources to learn more

ASP.NET Core 1.0

ASP.NET 2015 in a Nutshell

.NET Framework 4.6 .NET Core 1.0 Full .NET Framework for any scenario and

library support on WindowsModular libraries & runtime optimized

for server and cloud workloads

ASP.NET 4.6 / System.Web

MVC 5.x

ASP.NET Core 1.0 app features:MVC, API, etc.

Core CLR .Net NativeASP.NET Core 1.0

Web API 2.2

WebForms

Visual BasicC#

Visual Basic (coming soon)

What about ASP.NET 5?

ASP.NET Core 1.0 was previously called ASP.NET 5It was renamed in January 2016

Announcement postMore details

You’ll still see it referred to as ASP.NET in Visual Studio and in some docs

Will be updated in next ASP.NET Core Release Candidate

Now MVC and Web API are just features of

ASP.NET Core

ASP.NET Core 1.0One set of concepts – remove duplicationWeb UI and Web APIsSmooth transition from Web Pages to MVC (future)Built DI firstRuns on IIS or self-hosted

ASP.NET Core 1.0 – Key Values

Choose your Editors and Tools

Open Source with Contributions Cross-PlatformOSS

Seamless transition from on-premises to cloud

Faster Development CycleTotally Modular

Fast

ASP.NET Core – Exeeds 1.15 Million request/s, 12.6 Gbpshttp://www.ageofascent.com/asp-net-core-exeeds-1-15-million-requests-12-6-gbps/

DemoGetting started with ASP.NET Core 1.0

Install from https://get.asp.net

16

DemoCreating an ASP.NET Core 1.0 project

From VS2015;

File > New Project > ASP.NET Web Application

From VS2015;

Select Web Application under ASP.NET 5 Templates

• Let’s explore the project structure and all the files that were automatically generated

ASP.NET Core 1.0 Project Structure

DemoWorking with ASP.NET Core 1.0 on Mac OSX

1. Install Mono for OS X (required by Visual Studio Code).

2. Install Visual Studio Code3. Install ASP.NET 5 for Mac OS X

• Full Instructions: https://docs.asp.net/en/latest/getting-started/installing-on-mac.html

Installing ASP.NET Core 1.0 on MAC OSX

1. DemoEditing project using Git & VS Code

TagHelpersHTML helpers expressed as tagsEx. Instead of: @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })Write this: <label asp-for="UserName" class="col-md-2 control-label"></label>

Easier to customize with additional attributes

Work seamlessly with the HTML editor

TagHelpers@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true)

<fieldset> <legend>Log in Form</legend> <ol> <li> @Html.LabelFor(m => m.UserName) @Html.TextBoxFor(m => m.UserName) @Html.ValidationMessageFor(m => m.UserName) </li>

TagHelpers<form anti-forgery=“true“ validation-summary=“true” action="Create“> <fieldset> <legend>Log in Form</legend> <ol> <li> <label for=“UserName”> <input for=“UserName”> <span validation-for="Name" style="color:blue" /> </li>

public interface ITagHelper{

int Order { get; }Task ProcessAsync(TagHelperContext context, TagHelperOutput output);

}

TagHelpers: Create Your Own

Examples: https://github.com/aspnet/Mvc/tree/dev/src/Microsoft.AspNet.Mvc.TagHelpers

Stuff you should Know AboutAdditional ResourcesChannel9: http://channel9.msdn.comMVA: http://www.microsoftvirtualacademy.com

BizSpark – http://www.bizspark.comFree AzureFree ToolsNetwork Partner Give to your startups for free

DreamSpark – http://www.dreamspark.comFree Azure for StudentsFree Tools for Students

ASP.NET Core ResourcesLatest ASP.net 5 newshttp://www.asp.net/vnext ASP.NET Installshttp://get.asp.net Documentationhttp://docs.asp.net ASP.net 5 Community Standuphttps://live.asp.net/

Questions?

• Contact Information• Joe.Raio@Microsoft.com• http://joeraio.com• @joescars

• Helpful Links• http://azure.Microsoft.com• http://www.dreamspark.com• http://www.bizspark.com

Helpful InfoDownload this presentation:

http://aka.ms/sfcc2016joe