
Mac OS 环境下 安装 Asp.Net及使用Yeoman 创建Asp.Net 项目
The installer will inform you of the steps it is taking and pause before proceeding. You can learn more about Homebrew here.到这一步,可能会出现 brew 已经安装了。可以执行:
Install the .NET Version Manager (DNVM)Once Homebrew is installed, install the DNVM by running brew tap aspnet/dnx from a Terminal window. If you need to update your version of DNVM, first run brew untap aspnet/dnx to delete the old commands, and then run the brew tap aspnet/dnx command again to get the updated scripts.If you had an older version of our Homebrew "tap" configured, you might get the following error: Could not create link for aspnet/dnx/kvm, as it conflicts with aspnet/k/kvm. In that case, simply run brew uninstall kvm to ensure any old versions of kvm are removed, then brew untap aspnet/k to remove the old tap. After that, the brew tap aspnet/dnx command should succeed.Next, run the command brew install dnvm to install the .NET Version Manager. This will also automatically install the latest DNX package from the feed.这一步可能出现没有权限的问题:执行
然后执行
完成安装。 一切正常了。Next, run dnvm to verify that your terminal understands this command. If it does not, run the command source dnvm.sh to link it, then try running dnvm again. You should see something like this:
安装 Asp.net generator
使用 yeoman 开启一个 Asp.Net 项目
这里使用 Nancy 框架, Nancy的介绍: 一个轻量级的 .Net Web Framework选择 Nancy ASP.Net Application同时给一个项目名字,这里用了 NacyApp项目基础文件框架就生产了。进入 NacyApp 目录执行
加载 依赖如果 dnu 命令执行失败, commond not found.执行命令:
如果执行 dnu restore 出现 取依赖包找不到的问题,切换一下源再试试,有两个可用的源:1. 2. 例如:
可以使用 core visual studio 打开工程,开始写程序。然后 dnx . kestrel 开始你的 NacyApp 就可以了这里有个有意思的事情,在terminal 里执行了 dnx . kestrel 后,如果想退出, 执行 ctrl+c 了以后,看到 terminal 没有反应,在浏览器里刷新一下页面, terminal 会出一个错误, 就退出了。
发布日期:2021-05-09 05:55:55
浏览次数:14
分类:博客文章
本文共 2792 字,大约阅读时间需要 9 分钟。
本文是按照英文原文:安装时遇到的问题的总结Blog。
原文提示如下:
Installing ASP.NET 5 On Mac OS X
By Steve SmithASP.NET 5 runs on the .NET Execution Environment (DNX), which is available on multiple platforms, including OS X. This article describes how to install DNX, and therefore ASP.NET 5, on OS X, using Homebrew.In this article:Install ASP.NET 5 on OS XInstall ASP.NET 5 on OS XASP.NET 5 requires DNX, which is installed and managed by the .NET Version Manager (DNVM). The DNVM is easily installed using a tool called Homebrew, which will also install the correct version of Mono for OS X.Install HomebrewThe first step is to install Homebrew if it's not already installed. This can be done from a Terminal prompt using this script:ruby -e "$(curl -fsSL |
brew -v |
chown root:wheel /usr/local/bin/brew |
brew link mono |
使用Yemoman 创建Asp.net 项目
Mac 上 Asp.net 环境搭建好了以后,自己手动去开始一个 Asp.net 项目,是比较繁琐的。 Yeoman 上已经有 Asp.net 的 generator.
如果没有 Yeoman 先安装 Yeoman, Yeoman 的介绍: Yeoman下面有各种项目基础框架的generator> npm install -g yo |
> npm install -g generator-aspnet |
> yo aspnet |
dnu restore |
source dnvm.sh |
dnu restore -s " |
原博客地址:
发表评论
最新留言
表示我来过!
[***.240.166.169]2025年04月09日 01时11分14秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
基于LabVIEW的入门指南
2021-05-08
weblogic之cve-2015-4852
2021-05-08
Java注释
2021-05-08
使用mybatis-generator生成底层
2021-05-08
Mybatis【5】-- Mybatis多种增删改查那些你会了么?
2021-05-08
lvs+keepalive构建高可用集群
2021-05-08
6 个 Linux 运维典型问题
2021-05-08
取消vim打开文件全是黄色方法
2021-05-08
一个系统部署多个tomcat实例
2021-05-08
Typescript 学习笔记六:接口
2021-05-08
MySQL-时区导致的时间前后端不一致
2021-05-08
bcolz的新操作
2021-05-09
POD类型
2021-05-09
Head First设计模式——迭代器模式
2021-05-09
记一次讲故事机器人的开发-我有故事,让机器人来读
2021-05-09
netcore中使用session
2021-05-09
【wp】HWS计划2021硬件安全冬令营线上选拔赛
2021-05-09
Ef+T4模板实现代码快速生成器
2021-05-09
Java面试题:Servlet是线程安全的吗?
2021-05-09