我想其中一个文件夹需要身份验证,我在该文件夹中新建了一个web.config文件
如果当中加入
<authentication mode="Forms">
        
        
      </authentication>
就报以下错误:
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.
 
请问有什么办法解决

解决方案 »

  1.   

    在iis中将文件夹配置为应用程序试一试
      

  2.   

    你的2.0建立的 web项目 没有使用IIS 虚拟 目录模式
    而是使用了 vs自带的 目录模式
    你需要将你的web应用程序文件夹设置成虚拟目录运行
      

  3.   

    iis -> 在虚拟目录上 右键属性 -> 创建 应用程序
      

  4.   

    将你的web应用程序文件夹设置成虚拟目录运行
      

  5.   

    谢谢各位,但我对vs2005还不是很熟,能否清楚一点.
    能否在vs2005里面设置IIS虚拟目录运行方式,在IIS manager里面找不到"创建应用程序"
    千万别扔鸡蛋,体谅下
      

  6.   

    设了好像还不行, 设了是不是默认80端口的
    如果在web.config不添加
    <authentication mode="Forms">
            
            
          </authentication>
    就不会出现错误