zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    利用Hexo搭建个人博客-环境搭建篇
    Appium的安装-MAC平台
    alias指令:设置命令别名
    Android学习——第一个NDK程序
    Android学习——windows下搭建Cygwin环境
    Android学习——windows下搭建NDK_r9环境
    Win7&Ubuntu12.04 双系统引导问题
    Android学习第三天-签名常用命令
    Android学习第三天-打包常用命令
    Android学习第二天-android常用命令
  • 原文地址:https://www.cnblogs.com/Whikiey/p/5847026.html
Copyright © 2011-2022 走看看