简体   繁体   English

如何使用IIS7发布ASP网站

[英]How to publish asp website using IIS7

I am trying to host my web application in IIS7 (for testing purposes). 我试图将我的Web应用程序托管在IIS7中(出于测试目的)。 I have checked tutorials how to do it, they are very similar, but i always get some errors. 我已经检查了如何做的教程,它们非常相似,但是我总是会遇到一些错误。 I guess i'm missing something, hope you could help me. 我想我缺少了一些东西,希望您能帮助我。

Things that i have now: 1. Installed IIS7 with asp net (the IIS welcome image is showing, so i guess its installed correctly) 2. Simple web application (only with Default.aspx and some other automatically generated files) 我现在拥有的东西:1.用ASP.NET安装IIS7(显示IIS欢迎图像,所以我猜它正确安装了)。2.简单的Web应用程序(仅使用Default.aspx和一些其他自动生成的文件)

I'm using tutorials like this one: http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0 我正在使用这样的教程: http : //www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0

For those who may not want to click the link, here are the steps of this tutorial (just with mages and some additional info): 对于那些可能不想单击链接的人,这里是本教程的步骤(仅包含法师和一些其他信息):

Step 1: From Visual Studio, publish your Web application. 步骤1:在Visual Studio中,发布您的Web应用程序。 Step 2: Copy the published application folder to "C:\\intepub\\wwwroot" [default] folder. 步骤2:将已发布的应用程序文件夹复制到“ C:\\ intepub \\ wwwroot” [默认]文件夹中。 Step 3: From RUN - > inetmgr -> OK "TestWeb" is a recently pasted webapplication on your wwwroot folder. 步骤3:从RUN-> inetmgr-> OK,“ TestWeb”是最近粘贴到您的wwwroot文件夹中的Web应用程序。 Step 4: We need to convert it to an application, just right click and then Click on "ConvertToApplication" as shown in the following picture: + How to create and assign application pools 步骤4:我们需要将其转换为应用程序,只需右键单击,然后单击“ ConvertToApplication”,如下图所示:+如何创建和分配应用程序池

Now about the errors i get when i'm trying to connect to the running Sample website: 1. If I'm using Framework 4.0 integrated application pool: HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list 2. If I'm using Framework 4.0 Classic application pool: HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler. 现在,我尝试连接到正在运行的示例网站时遇到的错误:1.如果我使用的是Framework 4.0集成的应用程序池:HTTP错误500.21-内部服务器错误处理程序“ PageHandlerFactory-Integrated”具有错误的模块“在其模块列表2中找到“ ManagedPipelineHandler”。如果我使用的是Framework 4.0 Classic应用程序池:HTTP错误404.17-找不到所请求的内容是脚本,并且不会由静态文件处理程序提供。

My guess is that something could be configured wrong in IIS7 or i might be publishing my web application not the way it has to be published, because they differ in tutorials that i am using. 我的猜测是,在IIS7中可能配置有误,或者我发布的Web应用程序可能不是发布方式,因为它们在我使用的教程中有所不同。 For now i am publishing, using File System option. 目前,我正在使用“文件系统”选项进行发布。 Is it the right one for IIS7? IIS7是否合适?

Hope anyone could explain me my mistakes. 希望任何人都可以向我解释我的错误。

Thanks, Walt 谢谢,沃尔特

The answer for the questioner was to run the aspnet_regiis.exe -i from the framework directory 发问者的答案是从框架目录运行aspnet_regiis.exe -i

Below suggestions and comments leading to this answer : 以下建议和评论导致此答案:


I never had problems when publishing websites and webservices on IIS7 (for the moment) but I did a little research and according to the following link : http://forums.asp.net/post/3225843.aspx It is suggested that after switching the AppPool to Classic .NET AppPool, it may be required for you to uncomment a section in the web.config which is necessary for IIS7 在IIS7上发布网站和Web服务时(暂时),我从未遇到过问题,但是我做了一些研究,并根据以下链接进行了研究: http : //forums.asp.net/post/3225843.aspx建议在切换后将AppPool转换为Classic .NET AppPool,可能需要您取消注释web.config中IIS7必需的部分的注释

Did you try that ? 你尝试过吗?

For number HTTP:500.21 check this asp.net forum 有关HTTP:500.21的编号,请访问此asp.net 论坛。

"Looks like you have not installed the asp.net feature from within IIS in "Add/Remove windows component" so that all the regstration needed to run asp.net is not present in your configuration." “看起来您好像没有在IIS中的“添加/删除Windows组件”中安装asp.net功能,因此在配置中不存在运行asp.net所需的所有注册。” from the page. 从页面。

For number 404.17 please check the asp.net module if properly installed or not. 对于404.17,请检查asp.net模块是否正确安装。 If not then you might have to install manually. 如果不是,那么您可能必须手动安装。 Check this thread . 检查该线程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM