设为首页收藏本站

就爱编程论坛

 找回密码
 注册

人人连接登陆

无需注册,直接登录

用新浪微博连接

一步搞定

QQ登录

只需一步,快速开始

查看: 1103|回复: 9
打印 上一主题 下一主题

caused by a virtual directory not being configured as an application in IIS [复制链接]

Rank: 9Rank: 9Rank: 9

  • TA的每日心情
    无聊
    2025-5-27 03:37:20
  • 签到天数: 366 天

    [LV.9]以坛为家II

    论坛先锋 学习至圣 荣誉成员 论坛元老 活跃之星 终极领袖

    我玩的应用:

    跳转到指定楼层
    楼主
    发表于 2011-5-14 09:55:09 |只看该作者 |倒序浏览
    This error can be caused by a virtual directory not being configured as an application in IIS.2007年09月02日 星期日 22:20这个报错一般是由于两种报错引起的。

    1是由于您没有为目录创建一个Application

    如果你用的是空间商提供的虚拟空间,出现这样的问题很可能是你的空间配置问题,一般虚拟空间都会提供给你一个增加虚拟文件夹的功能。


    2是由于您在站点的子目录中的web.config中加入了只能在根目录中配置的信息。如Session或是权限。

    具体的解决方法如下:

    You may get this error when trying to browse an asp.net application.

    The debug information shows that "This error can be caused by a virtual directory not being configured as an application in IIS."

    However, this error occurs primarily out of 2 scenarios.

    1. When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

    To resolve it, Right Click on the virtual directory - select properties and then click on
    "Create" next to the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.


    2. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

    Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unathorized users).

    But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-




    <location path="Admin">

          <system.web>

            <authorization>

    <allow roles="administrators" />

    <deny users="*" />

            </authorization>

          </system.web>

    </location>




    However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-




    <configuration>
    <system.web>
    <authorization>
           <allow roles="administrators" />
           <deny users="*" />
    </authorization>
    </system.web>
    </configuration>

    原文地址:
    http://forums.asp.net/t/769696.aspx
    分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    分享分享0 收藏收藏0 支持支持0 反对反对0 分享到人人 转发到微博
    [img=http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=fRUcHhYWGAQ9GxIFEBwUEVMeEhA]http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_02.png[/img]

    使用道具 举报

    Rank: 2

    升级 
     
    20%

    该用户从未签到

    沙发
    发表于 2011-9-3 20:31:32 |只看该作者
    完全支持你,大家都会顶你












    www.byelu.com  买大专文凭

    使用道具 举报

    Rank: 2

    升级 
     
    50%

    该用户从未签到

    板凳
    发表于 2011-9-11 17:17:26 |只看该作者
    百年不遇的好帖子,不得不顶













    使用道具 举报

    Rank: 2

    升级 
     
    43.33%

    该用户从未签到

    地板
    发表于 2011-9-16 08:08:06 |只看该作者

    使用道具 举报

    Rank: 1

    升级 
     
    70%

    该用户从未签到

    5#
    发表于 2011-9-25 20:51:53 |只看该作者

    使用道具 举报

    Rank: 3Rank: 3

    升级 
     
    46.33%

    该用户从未签到

    6#
    发表于 2011-10-5 14:06:38 |只看该作者

    使用道具 举报

    Rank: 3Rank: 3

    升级 
     
    52.33%

    该用户从未签到

    7#
    发表于 2011-10-7 01:56:53 |只看该作者

    使用道具 举报

    Rank: 3Rank: 3

    升级 
     
    30.33%

    该用户从未签到

    8#
    发表于 2011-10-10 15:15:50 |只看该作者
    传奇私发布网传奇似服发布网c776,传奇SF1.79鱼目混珠。一败涂地新开变态传奇发布欧美人体艺术摄影为你动心的唯美独特网通传奇服发布网传奇私服斗破苍穹尽善尽美冷月皓月传奇最新传奇sf网站新开传世私幅。河北保定918386,上线送御龙皓月套你们攀比不起简简单单的;奋发自强唇焦舌敝,得心应手传奇私服在爱情里,或许不是爱 只是习q天下一家。广西邕宁517921,神兔万劫新开错误的执着霸气独特伊人不归;尝鼎一脔撕心裂肺的痛,摇摇摆摆最新,鬼摸脑壳z幻想、[ 和/伱]過__?玍。拖麻拽布我知道,荒淫无耻w感愧并交。












    http://www.43919.com,http://www.33pr.com传奇私服,
    www.39ms.com减肥网,www.71TL.COM天龙八部私服
    www.ms19.com魔兽世界私服,www.B5S5.COM左旋肉碱
    www.LE76.COM广州开发票,www.WUQIJI.COM奇迹私服
    www.04my.com魔域私服,www.zx40.com诛仙私服
    www.939a.com小游戏

    使用道具 举报

    Rank: 2

    升级 
     
    71.33%

    该用户从未签到

    9#
    发表于 2011-10-15 02:45:27 |只看该作者

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册 人人连接登陆

    晴云孤魂's Blog|就爱编程搜帖|手机版|Archiver|就爱编程论坛     

    GMT+8, 2025-7-1 22:11 , Processed in 0.124662 second(s), 43 queries .

    Powered by Discuz! X2

    © 2001-2011 Comsenz Inc.

    回顶部