如何在IIS中将虚拟目录配置为应用程序 [英] How do I configure a virtual directory as an application in IIS

查看:81
本文介绍了如何在IIS中将虚拟目录配置为应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是经验丰富的Web开发人员,我通常会编写应用程序代码,但有人要求我查看用C#编写的网站.我有一个Visual Studio 2012副本,并将源代码复制到了c:\ inetpub \ wwwroot文件夹中.当我尝试运行它时,我收到一条有关将虚拟文件夹创建为应用程序的错误消息,因此我安装了IIS,然后从wwwroot下创建了一个虚拟文件夹.它在运行时似乎可以正常工作,但是在数据库为空时崩溃了.当我更正错误并尝试再次运行时,出现此错误.

I'm not an experienced web developer, I usually code apps but I've been asked to look at a website written in C#. I've got a copy of Visual Studio 2012 and I copied the source code into my c:\inetpub\wwwroot folder. When I tried to run it I got an error message about creating a virtual folder as an application so I installed IIS and then created a virtual folder off of wwwroot. That seemed to work as it ran but then crashed as the database was empty. When I corrected the error and tried to run again I got this error.

C:\inetpub\wwwroot\WebApplication2\obj\Debug\Package\PackageTmp\Web.config(36): Build (web): It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

创建虚拟目录时,我错过了什么?我尝试删除第一个虚拟目录,然后在网站文件夹中创建另一个.那再次起作用,但是当它崩溃时,同样的事情又发生了.为什么是这样?

What have I missed as I've created the virtual directory? I tried deleting the first virtual directory and then creating another within the website folder. That worked again but when it crashed the same thing happened again. Why is this?

推荐答案

您没有说您正在使用哪个版本的IIS.

You don't say which version of IIS you are using.

在IIS管理器中,当您右键单击该网站时,选择添加应用程序"而不是添加虚拟目录".那应该让您开始.您应该阅读IIS版本,例如,该版本适用于IIS 7: https://technet.microsoft.com/zh-cn/library/cc772042(v = ws.10).aspx .

In IIS Manager, when you right click the web site, choose Add Application rather than Add Virtual Directory. That should get you started. You should read up on your version of IIS, e.g., this is for IIS 7: https://technet.microsoft.com/en-us/library/cc772042(v=ws.10).aspx.

这篇关于如何在IIS中将虚拟目录配置为应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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