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

今天想试试在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..x::1.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

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

ubuntu下 net core 安装web模板的更多相关文章

  1. net core 安装web模板

    ---恢复内容开始--- 今天想试试在Linux用C#开发WebAPI,查了下,要用: dotnet new -t Web 来建立工程,结果我试了下,出来这段: Invalid input switc ...

  2. Ubuntu下搭建NodeJS+Express WEB开发框架

    Ubuntu下搭建NodeJS+Express WEB开发框架 2012-12-27 15:06 作者: NodeJSNet 来源: 本站 浏览: 2,966 次阅读 我要评论暂无评论 字号: 大 中 ...

  3. ubuntu下的openfire安装、配置、运行

    openfire服务器              Openfire 采用Java开发,开源的实时协作(RTC)服务器基于XMPP(Jabber)协议.您可以使用它轻易的构建高效率的即时通信服务器.Op ...

  4. Ubuntu下opencv的安装及IDEA开发配置

    Ubuntu下opencv的安装及IDEA开发配置 环境配置  这篇博客主要介绍Ubuntu下opencv的安装编译,以及IDEA对opencv进行Java开发的环境配置 安装opencv 首先安装o ...

  5. Ubuntu下git的安装与使用

    Ubuntu下git的安装与使用 Ubuntu下git的安装与使用与Windows下的大致相同,只不过个人感觉在Ubuntu下使用git更方便. 首先,确认你的系统是否已安装git,可以通过git指令 ...

  6. Ubuntu下Speedtest的安装

    要安装Speedtest,需要先安装apache,参见<Ubuntu下Apache的安装>一文:*(再安装LAMP server,参见<Ubuntu下快速安装LAMP server& ...

  7. Ubuntu下Apache的安装

    Ubuntu下可快速安装LAMP server(Apache+MySQL+PHP5),参见<Ubuntu下快速安装LAMP server>一文. 也可以手动安装Apache.本文介绍如何手 ...

  8. Linux(Ubuntu)下MySQL的安装与配置

    转自:http://www.2cto.com/database/201401/273423.html 在Linux下MySQL的安装,我一直觉得挺麻烦的,因为之前安装时就是由于复杂的配置导致有点晕.今 ...

  9. ubuntu下boost编译安装

    ubuntu下boost编译安装 boost 安装 1.依赖安装 apt-get install mpi-default-dev libicu-dev python-dev python3-dev l ...

随机推荐

  1. C# to il 9 Properties and Indexers(属性和索引器)

    A field is simply a memory location, whereas, a property is a collection of methods. Aproperty is re ...

  2. str_replace中的匹配空白符,必须用双引号

    例: $minUnit = str_replace(array('\r','\n'),"",$content); 执行上面的语句,你会发现,文本没有任何变化,该换行的地方还是换行. ...

  3. kafka 的经典教程

    一.基本概念 介绍 Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了普通消息系统的功能,但具有自己独特的设计. 这个独特的设计是什么样的呢? 首先让我们看几个基本的消息系统术语:Kafk ...

  4. PHP中strlen和mb_strlen的区别

    在PHP中,strlen与mb_strlen是求字符串长度的函数,下面通过例子,讲解这两者之间的区别. <?php //测试时文件的编码方式要是UTF8 $str='中文a字1符'; echo ...

  5. SQL Server 2005无法远程连接的解决方法 (转帖)

    方法如下:  一.为 SQL Server 2005 启用远程连接1. 单击"开始",依次选择"程序"."Microsoft SQL Server 2 ...

  6. Jmeter中Websocket协议支持包的使用

    Jmeter中Websocket协议支持包的使用(转) 参考的来源是国外一篇文章,已经整理成pdf格式(http://yunpan.cn/cFzwiyeQDKdh3 (提取码:9bcf)) 转自:ht ...

  7. 基于Eclipse搭建hadoop开发环境

    一.基础环境准备 1.Eclipse 下载地址:http://pan.baidu.com/s/1slArxAP 2.JDK1.8  下载地址:http://pan.baidu.com/s/1i5iNy ...

  8. Git的一些东西(后续补充)

    查看帮助,要装git-doc,另外推荐git的图形客户端gitg,比gitk好看多了,用apt-get install就可   HEAD是当前工作版本的指针   --global保存的是当前用户的配置 ...

  9. ubuntu-docker入门到放弃(一)docker的安装

    基于ubuntu14.04系统 安装参考官网:https://docs.docker.com 1.首先检查是否安装过docker,如果安装过,卸载: sudo apt-get remove docke ...

  10. LINUX 内存使用情况

    # free 显示结果如下: Mem:表示物理内存统计 total 内存总数 8057964KBused 已使用的内存 7852484KBfree 空闲的内存数 205480KBshared 当前已经 ...