Chapter 1 Introduction C#-Note for BEGINNING C# 7 Programming with Visual Studio 2017

Devlopment Enviroment

  • C# 7
  • .NET 4.7
  • Visual Studio Community 2017
  • SQL Server Express

What the .NET Framework is ?

  1. The .NET Framework (now at version 4.7) is a revolutionary platform created by Microsoft for
    developing applications(such as Desktop Application、Windows Store Application、cloud/web Application、Web APIS、etc) .
  2. The .NET Framework consists primarily of a gigantic library of code and This library is categorized into different modules.
  3. The .NET Framework has been designed so that it can be used from any language, including C#(the subject of this book) as well as C++, F#, JScript, Visual Basic.Not only do these languages have access to the .NET Framework, but they can also communicate with each other. It is possible for C# developers to make use of code written by Visual Basic programmers, and vice versa.

Mono

  • an open source version of the .NET Framework (including a C# compiler) that runs on several operating systems,including various -?avors of Linux and Mac OS.you can read more about it at mono-project.com

.NET Core

  • Microsoft has also created a cross platform open source library called .NET Core https://github.com/dotnet/core
  • the .NET Compact Framework and the .NET Micro Framework are forks of the .NET Framework,like .NET Core, which was created as the most optimal solution for cross-platform code development.
  • .NET Core applications work similar to .NET Framework applications; however, instead of using the CLR it uses CoreCLR.

.NET Standard

  • 解决 .NET Framework 不同的分支框架(.NET Compact Framework、.NET Micro Framework)对Base Class Library(BCL)中的一些基础功能API不同的实现问题,为其提供统一的标准。
  • .NET Standard provides a unifed class library which can be targeted from multiple .NET platforms like the .NET Framework, .NET Core, and Xamarin.

使用 .NET Framework 和 .NET Core 编写应用程序

  1. Application code is wrriten using a .NET-compatible language such as C#.
  2. That code is compiled into CIL, which is stored in an assembly
  3. When this code is executed, it must first be compiled into native code using a JIT compiler.
  4. The native code is executed in the context of the managed CLR/CoreCLR, along with any
    other running applications or processes

CIL&JIT compile code

  1. first stage: you compile your code into Common Intermediate Language (CIL) code(visual studio 将你的代码翻译成平台无关的CIL代码)
  2. second stage: just-in-time (JIT) compiler compiles CIL into native code (即时编译器将平台无关的CIL代码翻译成可运行在特定平台上的本地代码)
  3. JIT compilers (as their name suggests) use CIL code, which is independent of the machine, operating system, and CPU. Several JIT compilers exist, each targeting a different architecture, and the CLR/CoreCLR uses the appropriate one to create the native code required.(不同平台有不同的即时编译器,将平台无关的CIL代码翻译成可执行的本地代码)

managed code (代码托管)
Code written using the .NET Framework and .NET Core are managed when it is executed (a stage usually referred to as runtime). This means that the CLR/CoreCLR looks after your applications by managing memory, handling security, allowing crosslanguage debugging, and so on.

Garbage Collection(垃圾回收)
One of the most important features of managed code.

Application You Can Write with C#

  1. Desktop applications
  2. Windows Store applications
  3. Cloud/Web applications
  4. Web APIs
  5. WCF services

About Visual Studio

像Intellij Idea 一样利用Modules组织项目,Visual Studio 利用Solutions组织项目( solutions can contain multiple projects, you can group together related code in one place)

the version of Visual Studio

  1. Visual Studio Code
  2. Visual Studio Community
  3. Visual Studio Professional
  4. Visual Studio Enterprise

附录

翻译

  • performance is critical: 性能是至关重要的
  • freed up completely:(内存)完全释放
  • progressive slowdown : 逐步放缓
  • system crash: 系统崩溃

术语

  • CTS: Common Type System(Part of the .NET Framework library defnes some basic types)
  • CLR: Common Languages Runtime(which is responsible for the execution of all applications developed using the.NET library)
  • BCL: Base Class Libaries(contain APIs for basic actions most developers need a program to do. These actions include, for example, fle access,string manipulation, managing streams, storing data in collections, security attributes, and manyothers. )
  • MSIL: CIL的旧称
  • GAC: Global Assembly Cache( place the reusable code in a place accessible to all applications)

链接
书本源代码

.NET Core

Mono

visual studio

猜你喜欢

转载自blog.csdn.net/DMW2016/article/details/84244472