asp.net-mvc 在 Mac 上运行 IIS 的最简单方法?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10765309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 01:58:47  来源:igfitidea点击:

Lightest way to run IIS on Mac?

asp.net-mvcmacosiis-7monovirtual-machine

提问by TruMan1

I have an ASP.NET MVC 4 app that I would like to run on a Mac machine. I would hate to run a full blown Windows virtual machine when all I really need is IIS7 to run the MVC app. What is the lightest way to run this (VirtualBox, Parallels, IIS7 Express, etc)? Really my goal is to code the Javascript/client-side of the app on my Mac and I am trying really hard not to do my development on a Windows machine :)

我有一个 ASP.NET MVC 4 应用程序,我想在 Mac 机器上运行它。当我真正需要的是 IIS7 来运行 MVC 应用程序时,我不想运行一个完整的 Windows 虚拟机。运行它的最简单方法是什么(VirtualBox、Parallels、IIS7 Express 等)?实际上,我的目标是在 Mac 上编写应用程序的 Javascript/客户端代码,并且我非常努力地尝试不在 Windows 机器上进行开发:)

采纳答案by knocte

Follow this link(provided by @LexLi in a comment above) to know how to set up your MVC environment.

按照此链接(由@LexLi 在上面的评论中提供)了解如何设置您的 MVC 环境。

With regards to IIS, as far as I know it cannot be done. You should use the native web server of your operating system. IIS doesn't run on Mac, so I guess you should try Apache, and then install module "mod_mono".

至于 IIS,据我所知,这是不可能的。您应该使用操作系统的本机 Web 服务器。IIS 不能在 Mac 上运行,所以我想你应该尝试 Apache,然后安装模块“mod_mono”。

Or if that gets too hairy, just use the standalone mono web server called XSP.

或者,如果这太麻烦了,只需使用名为 XSP 的独立单声道 Web 服务器。

Or run FastCGI, or nginx.

或者运行 FastCGI 或 nginx。

It is all explained here: http://www.mono-project.com/ASP.NET

这一切都在这里解释:http: //www.mono-project.com/ASP.NET

回答by Lilith River

I use Parallels, and although their software was poor a few years back, it's now lightyears ahead of VMWare in stability and performance. Parallels Desktop 7 for mac is awesome.

我使用 Parallels,尽管几年前他们的软件很差,但现在它在稳定性和性能方面领先于 VMWare 数光年。Parallels Desktop 7 for mac 非常棒。

My only computer is a MBP, yet I develop software for IIS. I run Parallels in Coherence mode, and I essentially have VisualStudio as just another mac app. And since I'm only running one app in the VM, it's way more stable than a normal PC install. I actually haven't rebooted it in 2 months so far!

我唯一的计算机是 MBP,但我为 IIS开发软件。我在 Coherence 模式下运行 Parallels,并且我基本上将 VisualStudio 作为另一个 mac 应用程序。而且由于我只在 VM 中运行一个应用程序,它比普通的 PC 安装更稳定。到目前为止,我实际上已经有 2 个月没有重新启动它了!

Only caveat - you want to dedicate 2-4GB of ram to the VM to prevent paging, so you should try to get more than 8GB if you're a polyglot developer. Having multiple IDEs on multiple OSes can be heavy, and when you add the memory-hogging yet blazingly fast Chrome to the mix, you'll hit that ram limit often...

唯一的警告 - 您希望将 2-4GB 的内存专用于 VM 以防止分页,因此如果您是多语言开发人员,您应该尝试获得超过 8GB 的​​内存。在多个操作系统上拥有多个 IDE 可能很繁重,当您将占用内存但速度极快的 Chrome 添加到组合中时,您将经常达到该内存限制......

回答by Soundararajan

Xsp is a alternative for IIS in Mac, that can run basic capabilities.

Xsp 是 Mac 中 IIS 的替代品,可以运行基本功能。

回答by Hymansonkr

I recently used VirtualBoxwith a copy of windows home(free with "I don't have key") and installed visual studioon it (community version). And IIS Express works just fine, TFS repos work too.

我最近将VirtualBoxwindows home的副本一起使用(免费提供“我没有密钥”)并在其上安装了Visual Studio(社区版)。IIS Express 运行良好,TFS 存储库也运行良好。