• Windows 下开发.NET Core应用


    一、使用Visual Studio 2015开发
    1.1 依次安装
    Visual Studio 2015 Update 3
    .NET Core 1.0.0 - VS 2015 Tooling Preview 2
    1.2 IDE中新建.NET Core项目,使用Nuget管理器,这些大家就都熟悉啦
    1.3 发布应用,写好的程序要发布到服务器上这是必需的
    解决方案管理器》要发布项目》右键》发布》选择文件系统,就会发布到本地的binDebugPublishOutput目录啦
    二、使用命令行方式开发
    如果觉得前一种方式不爽,不想安装那么大的VS2015,那就用这种方式吧
    2.1 安装.NET Core SDK for Windows和Visual Studio Code(以下简称Code)
    2.2 使用命令行创建一个项目
    mkdir HelloWorldApp
    cd HelloWorldApp
    dotnet new
    2.3 打开Code,安装C#扩展,打开HelloWorldApp目录,对C#代码进行编辑
    2.3 编译运行
    ::恢复Nuget包
    dotnet restore
    ::编译运行
    dotnet run
    2.4 发布
    dotnet publish

    附:dotnet命令(全名:Microsoft .NET Core Shared Framework Host)

    C:>dotnet --help
    .NET Command Line Tools (1.0.0-preview2-003121)
    Usage: dotnet [host-options] [command] [arguments] [common-options]

    Arguments:
    [command] The command to execute
    [arguments] Arguments to pass to the command
    [host-options] Options specific to dotnet (host)
    [common-options] Options common to all commands
    Common options:
    -v|--verbose Enable verbose output
    -h|--help Show help
    Host options (passed before the command):
    -v|--verbose Enable verbose output
    --version Display .NET CLI Version Number
    --info Display .NET CLI Info
    Common Commands:
    new Initialize a basic .NET project
    restore Restore dependencies specified in the .NET project
    build Builds a .NET project
    publish Publishes a .NET project for deployment (including the runtime)
    run Compiles and immediately executes a .NET project
    test Runs unit tests using the test runner specified in the project
    pack Creates a NuGet package

  • 相关阅读:
    input file 多张图片上传 获取地址 ——fileReader
    15个常用的javaScript正则表达式
    sublime-emmet
    AMD-requireJS
    jQuery-lazyload参数
    easyui 查询条件form 数据遍历
    导出excel设置金额格式
    html5页面添加时间戳
    创建枚举
    定义实体转json需要方法
  • 原文地址:https://www.cnblogs.com/Whikiey/p/5847026.html
Copyright © 2020-2023  润新知