text
stringlengths 0
13.4k
|
---|
If you're confused by all this naming, no worries! We'll get to some real |
code in a bit. |
A note to ASP.NET 4 developers |
If you haven't used a previous version of ASP.NET, skip ahead to the |
next chapter. |
8 |
Introduction |
ASP.NET Core is a complete ground-up rewrite of ASP.NET, with a focus |
on modernizing the framework and finally decoupling it from |
System.Web, IIS, and Windows. If you remember all the OWIN/Katana |
stuff from ASP.NET 4, you're already halfway there: the Katana project |
became ASP.NET 5 which was ultimately renamed to ASP.NET Core. |
Because of the Katana legacy, the Startup class is front and center, and |
there's no more Application_Start or Global.asax . The entire pipeline |
is driven by middleware, and there's no longer a split between MVC and |
Web API: controllers can simply return views, status codes, or data. |
Dependency injection comes baked in, so you don't need to install and |
configure a container like StructureMap or Ninject if you don't want to. |
And the entire framework has been optimized for speed and runtime |
efficiency. |
Alright, enough introduction. Let's dive in to ASP.NET Core! |
9 |
Your first application |
Your first application |
Ready to build your first web app with ASP.NET Core? You'll need to |
gather a few things first: |
Your favorite code editor. You can use Atom, Sublime, Notepad, or |
whatever editor you prefer writing code in. If you don't have a favorite, |
give Visual Studio Code a try. It's a free, cross-platform code editor that |
has rich support for writing C#, JavaScript, HTML, and more. Just search |
for "download visual studio code" and follow the instructions. |
If you're on Windows, you can also use Visual Studio to build ASP.NET |
Core applications. You'll need Visual Studio 2017 version 15.3 or later |
(the free Community Edition is fine). Visual Studio has great code |
completion and refactoring support for C#, although Visual Studio Code |
is close behind. |
The .NET Core SDK. Regardless of the editor or platform you're using, |
you'll need to install the .NET Core SDK, which includes the runtime, |
base libraries, and command line tools you need for building ASP.NET |
Core applications. The SDK can be installed on Windows, Mac, or Linux. |
Once you've decided on an editor, you'll need to get the SDK. |
10 |
Get the SDK |
Get the SDK |
Search for "download .net core" and follow the instructions on |
Microsoft's download page to get the .NET Core SDK. After the SDK has |
finished installing, open up the Terminal (or PowerShell on Windows) and |
use the dotnet command line tool (also called a CLI) to make sure |
everything is working: |
dotnet --version |