尝试在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的模板,用来初始化项目.更多的就不多说了,写一遍都写不完,自己看吧 ...
随机推荐
- weed-fs 基础测试
=================== 启动 master 端口:9333 =================== sunsl@test-server:~$ weed master I0102 15: ...
- redis info参数详解
redis 127.0.0.1:6381> info redis_version:2.4.16 # Redis 的版本redis ...
- XidianOJ 1172 Hiking
题目描述 BlacKin and GKCY are going hiking together. Besides their personal items, there are some items ...
- 4.0以后的新布局方式GridLayout
<?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android=" ...
- linux C学习笔记03--单链表
单链表一直是程序员的基础,我也来复习下,下面是link.c中的代码,供main.c 调用,代码很简单,单链表的插入,删除,查找和遍历输出, #include <stdio.h> #incl ...
- IE 下JS和CSS 阻塞后面内容总结
总结: 1. CSS 都是可以并行下载的. 2. IE6 和 IE7 JS 不能并行下载,CSS 和 JS 阻塞后面内容下载. 3. IE8 JS 还是会阻塞图片下载 开始改变加载模式, ...
- Multipart to single part feature
Multipart to single part feature Explode Link: http://edndoc.esri.com/arcobjects/8.3/?URL=/arcobject ...
- Vc++ 控件用法总结之List Control
1.新建对话框MFC,在对话框上放一个ListCtrl ID:IDC_PATH View:Report 2.为ListCtrl添加变量 右击->添加变量m_wndPath 3.找到OnInitD ...
- ubuntu 挂载windows共享目录的方法
建立windows共享目录 右击要共享的文件夹-->属性-->高级共享-->添加用户-->添加完全控制权限 假设建立的共享地址为\\192.168.1.100\Linux 获取 ...
- jstl格式化数字
jstl中的<fmt:formatNumber>标签 设置显示时间戳<% request.setAttribute("currentTimeStamp" ...