zoukankan      html  css  js  c++  java
  • 【NetCore入门】安装和搭建基于netcore的demo

    声明:只是学习记录,参考了官方教程,看到的朋友,也别喷抄袭啥的,本身就是学习笔记记录而已。

    准备:

      VS2015、aspnet5(RC1RC2可能会有所不同,详见下面截图)

      window7 X64

    RC2 :https://download.microsoft.com/download/4/6/1/46116DFF-29F9-4FF8-94BF-F9BE05BE263B/DotNetCore.1.0.0.RC2-VS2015Tools.Preview1.exe

      主要的是,教程里第一步说的是,如果是升级RC2,要把老的版本卸载掉。我安装时候,并没有手动卸载,而直接安装了RC2.

      还就是,有些教程里说,安装RC2,需要安装VS2015update2.

      具体更新教程,参考官方:https://www.microsoft.com/net/core#windows

    名词解释 

    DNX:.NET Execution Environment,即.NET运行时环境,在Windows,Mac和Linux下运行.NET应用程序的环境(有点目前windows环境下的.NET Framework的意思),当然这东西是跨平台的,这是跟.NET Framework最大的不同之处。
    DNVM:NX Version Manager,即DNX的版本管理工具,利用DNVM可以管理DNX的不同版本,你可以轻松切换到不同的DNX版本中。
    .NET Core:可以理解为一个经过精简的、模块化的.NET Framework子集,目的是为了跨平台。.NET Core有一系列的类库组成,叫做"CoreFX",一个更精简的版本叫做"CoreCLR"。

    步骤:

      1、安装VS2015,没啥好说的,主要是不要忘记安装“Microsoft Web开发工具”;

      2、启动VS2015,新建项目,选择aspnet5模板;此时如果是默认安装的VS2015,那么会有个RC的选项,此时,你需要关闭VS2015,然后安装aspnet5 的一个模板;安装完毕后,会有三个选项:

      3、新建项目:

    4、然后创建项目,大致结构如下:

     

    5、F5 运行项目;

    Tips:

      在此过程中,纠结的是那个模板选项,刚开始是默认一个,但是教程里说的是类似上图的三个;后来独立安装了AspNet5.ENU.RC1_Update1_KB3137909.exe 就可以了。(如果打了update2的补丁,下载的应该是RC2)

    ==============

    2016-5-17 补充

    如果是RC2,创建项目时,多了一个选择:

     

    项目目录也有所改变:

    ===以下摘选自官方教程===============

    File namePurpose
    project.json

    The presence of a project.json file defines a .NET Execution Environment (DNX) project. It is the project.json file that contains all the information that DNX needs to run and package your project. For additional details, including the project.json file schema, see Working with DNX Projects.

    该文件定义了一个DNX项目,包含了所有DNX项目运行和打包所需要的资源。

    global.json

    Visual Studio uses this file to configure the project.

    VS 使用该文件配置项目。比如SDK版本等;

    appsettings.json

    This file allows you to include additional project information, such as connection string values. For more information, see Configuration.

    允许你包含一些额外的项目信息。

    Startup.cs

    The Startup class provides the entry point for an application. The Startup class must define a Configure method, and may optionally also define a ConfigureServices method, which will be called when the application is started. For more information, see Application Startup.

    应用程序入口点,当项目启动时会调用该类中的对应方法。

    Index.cshtml This view contains the HTML for the default page of the view.
    _Layout.cshtml This view contains common HTML for multiple pages of the web app.
    HomeController.cs This controller contains the classes that handle incoming browser requests, retrieve model data, and then specify view templates that return a response to the browser.

    参考:

    https://docs.asp.net/en/latest/getting-started/installing-on-windows.html

    http://www.cnblogs.com/richieyang/p/5281761.html#top

    http://www.cnblogs.com/artech/p/asp-net-core-di-register.html

    点滴积累,每天进步一点点!O(∩_∩)O~
  • 相关阅读:
    HTML
    MySQL 表操作
    MySQL 库操作
    MySQL
    python 客户端的安全性验证和服务端对客户端的多端连接
    python 黏包
    python 通信
    SpringData —— HelloWorld
    JPA
    Hibernate ——二级缓存
  • 原文地址:https://www.cnblogs.com/hager/p/5483066.html
Copyright © 2011-2022 走看看