zoukankan      html  css  js  c++  java
  • ubuntu下 net core 安装web模板

    ---恢复内容开始---

    今天想试试在Linux用C#开发WebAPI,查了下,要用:

    dotnet new -t Web

    来建立工程,结果我试了下,出来这段:

    Invalid input switch:
    -t
    Web
    Run dotnet new --help for usage information.
    See https://aka.ms/dotnet-install-templates to learn how to install additional template packs.

    后面给了个提示:请到https://github.com/aspnet/Tooling/blob/master/missing-template.md学习怎么安装模板,进入一看就一句:

    dotnet new -i Microsoft.DotNet.Web.ProjectTemplates.1.x::1.0.0-*

    就这还专门让我进网站来"学"...

    输入指令,得到下面结果:

      Restoring packages for /root/.templateengine/dotnetcli/v2.0.0/scratch/restore.csproj...
      Installing Microsoft.DotNet.Web.ProjectTemplates.1.x 1.0.0-beta2-20170629-269.
      Generating MSBuild file /root/.templateengine/dotnetcli/v2.0.0/scratch/obj/restore.csproj.nuget.g.props.
      Generating MSBuild file /root/.templateengine/dotnetcli/v2.0.0/scratch/obj/restore.csproj.nuget.g.targets.
      Restore completed in 1.82 sec for /root/.templateengine/dotnetcli/v2.0.0/scratch/restore.csproj.
    
    
    Templates                                 Short Name       Language          Tags               
    ------------------------------------------------------------------------------------------------
    Console Application                       console          [C#], F#, VB      Common/Console     
    Class library                             classlib         [C#], F#, VB      Common/Library     
    Unit Test Project                         mstest           [C#], F#, VB      Test/MSTest        
    xUnit Test Project                        xunit            [C#], F#, VB      Test/xUnit         
    ASP.NET Core Empty                        web              [C#], F#          Web/Empty          
    ASP.NET Core Web App                      mvc              [C#], F#          Web/MVC            
    ASP.NET Core Web App                      razor            [C#]              Web/MVC/Razor Pages
    ASP.NET Core with Angular                 angular          [C#]              Web/MVC/SPA        
    ASP.NET Core with React.js                react            [C#]              Web/MVC/SPA        
    ASP.NET Core with React.js and Redux      reactredux       [C#]              Web/MVC/SPA        
    ASP.NET Core Web API                      webapi           [C#], F#          Web/WebAPI         
    global.json file                          globaljson                         Config             
    Nuget Config                              nugetconfig                        Config             
    Web Config                                webconfig                          Config             
    Solution File                             sln                                Solution           
    Razor Page                                page                               Web/ASP.NET        
    MVC ViewImports                           viewimports                        Web/ASP.NET        
    MVC ViewStart                             viewstart                          Web/ASP.NET        
    
    
    Examples:
        dotnet new mvc --framework netcoreapp1.1 --auth Individual
        dotnet new web 
        dotnet new --help
    

      看来是安装成功了.

    建立工程运行试试:

    dotnet new web
    dotnet restore
    dotnet run

    运行成功.显示监听了本机5000端口

    打开试试: http://localhost:5000

    可以看到页面,至此安装模板算是成功了

  • 相关阅读:
    golang学习 ---并发获取多个URL
    MySQL的my.cnf文件(解决5.7.18下没有my-default.cnf)
    Python ElasticSearch API
    linux 输出重定向 何时会写文件
    Linux top命令的用法详细详解
    mysql 5.7.13 安装配置方法(linux)-后期部分运维
    linux下各目录的作用
    MySQL 获得当前日期时间 函数
    mysql导入大批量数据出现MySQL server has gone away的解决方法
    python之MySQL学习——防止SQL注入
  • 原文地址:https://www.cnblogs.com/DragonStart/p/7513183.html
Copyright © 2011-2022 走看看