zoukankan      html  css  js  c++  java
  • .NET Core命令

    命令:

    查看版本

    dotnet --version
    

    查看已安装的SDK信息

    #### dotnet --list-sdks
    

    查看已安装的运行时信息

    #### dotnet --list-runtimes
    

    查看帮助命令

    dotnet -h
    

    创建项目(dotnet new)

    dotnet new -i .                             --查看已安装的项目模板
    dotnet new console -o ./myConsole            --通过指定模板创建项目,创建一个控制台项目
    dotnet new -i identityserver4.templates      --安装项目模板
    

    编译项目,生成二进制文件

    dotnet build
    

    发布项目(dotnet publish)

    dotnet publish -o /output -c Release
    

    清理

    dotnet clean
    

    运行项目,相当于F5(dotnet run)

    dotnet run -c Release  --Release版本
    dotnet watch run      --当代码改变时,自动编译运行,开发时使用
    

    下载依赖包(dotnet restore)

    使用NuGet还原在项目文件中定义的依赖关系和项目特定的工具

    dotnet restore    
    

    运行已编译项目

    nohup dotnet xxx.dll &		(ps:必须使用exit退出终端,否则后台进程会退出)
    

    将core项目部署到Linux:

    发布项目:dotnet publish -o /output -c Release
    运行项目:dotnet xxx.dll //编译好的项目直接运行即可
    后台运行项目:nohup dotnet xxx.dll & (ps:必须使用exit退出终端,否则后台进程会退出)

    使用supervisor运行项目:(推荐)

    yum install supervisor
    systemctl start supervisord.service
    touch /etc/supervisord.d/xxx.ini --添加一个项目的配置文件
    systemctl restart supervisord.service

    xxx.init中添加如下内容:

    [program:coreweb1]
    directory=/application/publish/CoreWeb
    command=/usr/bin/dotnet /application/publish/CoreWeb/CoreWeb.dll
    autostart=true
    autorestart=true
    stdout_logfile=/application/publish/logs/out.log
    stderr_logfile=/application/publish/logs/err.log
    
  • 相关阅读:
    Oracle Sql优化之日期的处理
    python excel转xml
    3、vue项目里引入jquery和bootstrap
    1、vue.js开发环境搭建
    2、vue-router2使用
    go 初步
    一个全局变量引起的DLL崩溃
    在linux用gdb查看stl中的数据结构
    gdb看core常用命令
    redis常用命令
  • 原文地址:https://www.cnblogs.com/fanfan-90/p/14018145.html
Copyright © 2011-2022 走看看