官术网_书友最值得收藏!

Setting Up Your Environment

One of the main benefits of .NET Core is that it is cross-platform, which means that it runs on a wide variety of operating systems. You no longer need a dependency on the Windows OS to host or even develop your .NET application. Although this was technically possible before, it is now easier than ever and actively encouraged by Microsoft. They even provide Linux servers on Azure and premade Docker images on which you can build and host your code.

In this chapter, we will show you how to get started with the latest tooling on the OS of your choice. We'll cover the process of setting up a development environment on Windows, macOS (previously OS X), and Linux. Each system has a preferred solution, but there is cross-platform tooling available that will work on any of them.

We will also discuss the modern DevOps way of developing applications and deploying them, using containers. In particular, we will cover how to work with Docker. Containers are a great way of packaging your application and its dependencies so that you can deploy more consistently and with fewer nasty surprises. By shipping your app as a standard unit, you can worry less about configuring a live production server or setting up a new developer workstation.

To get you started, we will cover the following topics in this chapter:

  • Windows
  • macOS
  • Linux
  • Visual Studio 2017
  • Visual Studio for Mac
  • Visual Studio Code
  • .NET Core SDK
  • Command-line tooling
  • Containerization
  • Docker

Feel free to skip to the step-by-step guide that is relevant to you. Or, read them all if you are interested in what the other side looks like. Although we won't be covering Visual Studio Code, command-line, and Docker in relation to every OS, these are applicable to all platforms. We would lose focus if we go over all the possible permutations in this book, and it would be a very long, repetitive read. Check out my blog at https://unop.uk/ for more varied tutorials. As Linux lacks an official .NET IDE and these command-line tools fit better into the Unix philosophy (many simple tools that do one thing well), we'll mostly cover them in the Linux section.

We won't be covering JetBrains Rider here, but if you're familiar with their other products (such as ReSharper, or Android Studio, which is based on the same IntelliJ platform), then you may want to give it a try. The main application is written in Java, and as such, it runs on most popular operating systems.

There are two main steps to setting things up. Firstly, install some tools to help you work more easily with the code. You could use a simple text editor, but this would not be a great experience. Secondly, install the .NET Core Software Development Kit (SDK) that now includes ASP.NET Core. This will hook into the tooling to provide templates and will also be usable from the command line. Later, we will use it to build and run our application. Let's get started!

主站蜘蛛池模板: 项城市| 花莲市| 大关县| 卢龙县| 乐平市| 共和县| 潜江市| 澜沧| 金湖县| 大竹县| 库尔勒市| 临沂市| 潼南县| 铜川市| 汾西县| 沂南县| 鱼台县| 肃宁县| 罗定市| 正镶白旗| 青神县| 阳西县| 台东县| 珠海市| 兴化市| 梨树县| 故城县| 迭部县| 宝山区| 逊克县| 汝州市| 安丘市| 襄樊市| 库尔勒市| 无棣县| 镇沅| 六盘水市| 木兰县| 米易县| 平凉市| 蒙阴县|