尝试在mac上用dotnet cli运行asp.net core示例程序
自从知道微软用dotnet cli取代dnx之后,一直在等dotnet cli支持asp.net core。。。
昨天看到这篇新闻(ASP.NET Core 1.0 Hello World)后,才知道原来dotnet cli早就支持asp.net core了,而且在github上有专门的示例程序。
于是,立马想在mac上体验一下。
首先去 http://dotnet.github.io/getting-started/ 下载并安装mac版的dotnet cli —— dotnet-osx-x64.latest.pkg。安装成功之后,就可以在terminal中运行dotnet命令:
$ dotnet
.NET Command Line Tools (1.0.0-beta-001556)
Usage: dotnet mmon-options] mmand] guments]
然后用git命令从github上签出 https://github.com/aspnet/cli-samples
git clone https://github.com/aspnet/cli-samples
cd cli-samples
然后运行dotnet restore命令安装nuget包包,出现了错误:
dotnet restore
log : Restoring packages for /Git/dotnet/cli-samples/HelloMvcApi/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloWebFull/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloMvc/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloWeb/project.json...
error: The type initializer for 'Crypto' threw an exception.
error: Unable to load DLL 'System.Security.Cryptography.Native': The specified module could not be found.
error: (Exception from HRESULT: 0x8007007E)
出现这个问题是由于我电脑上的openssl版本低(OpenSSL 0.9.8),dotnet cli需要的版本是OpenSSL 1.0.1或1.0.2。用homebrew安装最新版的openssl:
brew install openssl
安装之后,虽然openssl version显示的还是0.9.8,但这时dotnet restore命令已经可以正常运行了。
log : Restoring packages for /Git/dotnet/cli-samples/HelloWebFull/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloMvcApi/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloWeb/project.json...
log : Restoring packages for /Git/dotnet/cli-samples/HelloMvc/project.json...
info : GET https://www.myget.org/F/aspnetcidev/api/v3/flatcontainer/netstandard.library/index.json
原以为大功告成了,结果却是在dotnet restore期间nuget包包总是安装失败,比如出现下面的错误:
error: Failed to download package from 'https://www.myget.org/F/aspnetcidev/api/v3/flatcontainer/microsoft.aspnetcore.iisplatformhandler/1.0.0-rc2-16280/microsoft.aspnetcore.iisplatformhandler.1.0.0-rc2-16280.nupkg'.
error: The HTTP request to 'GET https://myget-2e16.kxcdn.com/privatefeedaspnetcidev/Microsoft.AspNetCore.IISPlatformHandler-1.0.0-rc2-16280?sv=2014-02-14&sr=b&sig=ARjy3JzGc36F5tS6EyvjEQWpI0JHL56vOkiJW8U9LV8%3D&st=2016-02-26T13:55:00Z&se=2016-02-26T15:05:00Z&sp=r&rscc=max-age%3D3600&rsct=binary%2Foctet-stream&rscd=filename%3DMicrosoft.AspNetCore.IISPlatformHandler.1.0.0-rc2-16280.nupkg' has timed out after 100000ms.
奇怪的是,不能安装的包包,通过浏览器或curl命令都能下载。而在linux电脑上没这个问题,dotnet restore一切正常,dotnet run轻松将asp.net core示例站点运行了起来。算了,直接在linux上折腾吧,暂时不在mac上尝试了。
尝试在mac上用dotnet cli运行asp.net core示例程序的更多相关文章
- .NET跨平台:在CentOS上编译dnx并运行ASP.NET 5示例程序
在之前的博文中我们在 Ubuntu 上成功编译出了 dnx ,并且用它成功运行了 ASP.NET 5 示例程序.在这篇博文中我们将 Ubuntu 换成 CentOS. 目前 dnx 的编译需要用到 m ...
- 在Mac下运行ASP.NET Core应用程序
在Mac下运行ASP.NET Core应用程序 通过参照.NET Core相关官方文档,在我的Mac电脑上用Visual Studio Code创建了我的第一个ASP.NET应用. 开发环境搭建 首先 ...
- Mac下运行ASP.NET Core应用程序
Mac下运行ASP.NET Core应用程序 在Mac下运行ASP.NET Core应用程序 通过参照.NET Core相关官方文档,在我的Mac电脑上用Visual Studio Code创建了我的 ...
- .NET跨平台:在Ubuntu上用自己编译的dnx运行ASP.NET 5示例程序
在 Linux Ubuntu 上成功编译 dnx 之后,会在 artifacts/build/ 文件夹中生成 dnx-coreclr-linux-x64/ 与 dnx-mono/ 这2个文件夹,前者是 ...
- ASP.NET Core 中文文档 第二章 指南(8) 使用 dotnet watch 开发 ASP.NET Core 应用程序
原文:Developing ASP.NET Core applications using dotnet watch 作者:Victor Hurdugaci 翻译:谢炀(Kiler) 校对:刘怡(Al ...
- 使用 dotnet watch 开发 ASP.NET Core 应用程序
使用 dotnet watch 开发 ASP.NET Core 应用程序 原文:Developing ASP.NET Core applications using dotnet watch作者:Vi ...
- 基于阿里云容器服务用docker容器运行ASP.NET 5示例程序
小试阿里云容器服务 之后,接下来有一个挡不住的小试冲动--用docker容器运行程序.首先想到的程序是 ASP.NET 5示例程序,于是参考msdn博客中的这篇博文 Running ASP.NET 5 ...
- 在Linux上用自己编译出来的coreclr与donet cli运行asp.net core程序
先在 github 上签出 coreclr 的源代码,运行 ./build.sh 命令进行编译,编译结果在 coreclr/bin/Product/Linux.x64.Debug/ 文件夹中. 接着签 ...
- 在Mac上开发使用yeoman构建Asp.net core项目并且实现分层引用
1.Yeoman? yeoman是一个自动化脚手架工具.它提供很多generator,generator相当于VisualStudio的模板,用来初始化项目.更多的就不多说了,写一遍都写不完,自己看吧 ...
随机推荐
- makefile学习小结
=============2016/08/15================ 上午完成makefile的试验,缩短了代码量,现在make强大,有缺省的变量,能自己推导关系,不需要gcc –MM -M ...
- RSA加密前端JS加密,后端asp.net解密,报异常
RSA加密前端JS加密,后端asp.net解密,报异常 参考引用:http://www.ohdave.com/rsa/的JS加密库 前端JS加密代码: function GetChangeStr() ...
- Multipart to single part feature
Multipart to single part feature Explode Link: http://edndoc.esri.com/arcobjects/8.3/?URL=/arcobject ...
- C语言 malloc calloc realloc alloc 在分配内存时的 区别
malloc : 向堆申请分配内存,不初始化 calloc : 向堆申请分配内存,初始化为0 realloc: 向堆申请分配内存,可调整大小 alloc : 向栈申请内存,不需手动释放
- OC 框架组织架构图
- INNO SETUP 5.5.0以上版本中文语言包
; *** Inno Setup version 5.5.0+ Chinese messages ***;; To download user-contributed translations of ...
- BigDecimal最基础用法
BigDecimal最基础用法 用字符串生成的BigDecimal是不会丢精度的. 简单除法. public class DemoBigDecimal { public static void mai ...
- sendEmail的使用
坑!坑!坑!今天又弄了一天如何发送邮件,首先用sendmail,postfix.....等,都试过了,各种报错,然后就从早上弄到现在,在群里问问题的时候,一位好心的大哥说了他用的是sendEmail, ...
- node.js 基础学习 express安装使用
安装好nodeJs,我们需要使用命令行中安装express. 我这里默认将Node.js安装在C:\Program Files\nodCejs\盘中. 在保持联网的状态下,依次输入如下命令. npm ...
- Servlet调用过程整理