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

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

  • 相关阅读:
    循环调用spring的dao,数个过后无响应
    WebEx如何录制电脑内的声音
    java对象转换String类型的三种方法
    使用Hibernate+MySql+native SQL的BUG,以及解决办法
    mysql之触发器trigger
    mysql 触发器学习
    Java对比两个数据库中的表和字段,写个冷门的东西
    PHP几个快速读取大文件例子
    Java安全中的“大坑”,跨平台真“浮云”
    国内一些大公司的开源项目
  • 原文地址:https://www.cnblogs.com/DragonStart/p/7513183.html
Copyright © 2011-2022 走看看