为 ASP.NET/ASP.NET MVC 3 配置 IIS (Windows 7) [英] Configuring IIS (Windows 7) for ASP.NET / ASP.NET MVC 3

查看:24
本文介绍了为 ASP.NET/ASP.NET MVC 3 配置 IIS (Windows 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正忙于使用 ASP.NET MVC 3 应用程序并使用 Windows 7.目前它使用内置的 Web 服务器来运行 Web 应用程序.我希望它在 IIS 中运行.在设置它以在 IIS 上运行时,有什么我需要了解的建议吗?

I am busy working with an ASP.NET MVC 3 application and using Windows 7. Currently it uses the built in web server to run the web application. I would like it to run in IIS. Is there any advice that I need to know about when setting this up to run on IIS?

一位工作人员说我的 Web 应用程序必须位于 wwwroot 目录中,IIS 才能正常工作.我对此的理解是,如果我创建了一个虚拟目录(Web 应用程序可以在任何目录中),那么我应该可以吗?

A guy from work said that my web application MUST be in the wwwroot directory for IIS to work properly. My understanding of this is that if I created a virtual directory (web application can then be in any directory) then I should be ok?

另外,我可以购买一些像样的书籍来帮助我更好地理解 IIS 吗?这不必特定于 ASP.NET MVC.我唯一知道如何在 IIS 中做的是创建一个虚拟目录:)

Also, are there decent books that I can purchase that can help me in understanding IIS better? This does not have to be specific to ASP.NET MVC. The only thing that I know how to do in IIS is to create a virtual directory :)

当应用程序在 IIS 中运行时,我将如何调试该应用程序?

How would I then debug the application when it is running in IIS?

任何建议和互联网文章将不胜感激:)

Any advice and internet articles would be appreciated :)

推荐答案

您可以使用 VS.NET 为您完成工作.在项目的属性页面中,切换到Web"选项卡并选择使用本地 IIS Web 服务器".提供您想要的网址和 VS.剩下的就去做.

You can use VS.NET do to the work for you. In your project's properties page, switch to the "Web" tab and slect "Use Local IIS Web Server". Provide the url you desire and VS. will do the rest.

为了具体回答您的问题,您的站点不必是 IIS 根文件夹的子文件夹才能正常工作并且调试将正常工作.

To answer your question specifically, no your site doesn't have to be a sub folder of IIS's root folder for this to work and debugging will work as normal.

仅供参考:我从不使用开发 Web 服务器,并且一直使用 IIS.我的大部分项目都是 IIS 根文件夹的子文件夹,我手动编辑 .proj 文件以将其指向正确的位置.但这不是工作所必需的.

FYI: I don't ever use the Development web server and have always used IIS. Most of my project are sub folders of IIS's root folder and I manually edit the .proj file to point it to the right place. But this is not required for things to work.

使用 Internet 信息服务管理器,您应该能够做的不仅仅是创建虚拟文件夹.事情要简单一些.

With Internet Information Services Manager you should be able to do a lot more than create virtual folders. Things are quite a bit simpler.

但是,对于 IIS 和 ASP.NET,一般而言.我建议您阅读 App Pools 及其流程模型(ProcessModel 下的各种选项以及其他部分).

However, as regards IIS and ASP.NET in general. I'd suggest you read up on App Pools and their process model (the various options under ProcessModel as well as other sections).

MSDN 和 http://www.iis.net/ 通常是获取相关信息的好地方IIS 的所有内容.

MSDN and http://www.iis.net/ are generally good places to get decent information on all things IIS.

顺便说一句,您可能还想看看最近推出的 IIS Express.它实际上取代了开发服务器,并且对于所有意图和目的来说都是真正的 IIS 7,因此可以使用 IIS 7 的所有功能.另外,如果由于某种原因您无法以管理员身份运行 VS,则无需以管理员身份运行.

As an aside, you may also want to look at the recently introduced IIS Express. It actually replaces the development server and is really IIS 7 for all intents and purposes so all of IIS 7's functionality is available. Plus you don't need to run your VS as administrator if for some reason you're not able to.

如果您能够在您的机器上以管理员身份运行 VS.NET,我建议您使用 IIS 7.

If you are able to run VS.NET as administrator on your machine I'd suggest using IIS 7.

这篇关于为 ASP.NET/ASP.NET MVC 3 配置 IIS (Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆