asp.net在web上运行的问题

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:55:02
程序在visual stdio上没问题
不过在给整个workspace拷贝到C:\inetpub\wwwroot\WebSite2
然后运行就出现了这个问题

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: 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.

Source Error:

Line 44: ASP.NET to identify an incoming user.
Line 45: -->
Line 46: <authentication mode="Windows"/>
Line 47: <!--
Line 48: The <customErrors> section enables configuration

Source File: C:\inetpub\wwwroot\website2&#

这时由于你的根目录下存在有另外的web.config,所以在子文件夹中的web.config不能注册<authentication mode="Windows"/> 。。删除这个节点即可 另外 如果你在这个web.config中配置有其他应用程序级的节点 也需要一并删除 或者转移到根目录的web.config中。。。还有的做法就是 直接将IIS配置指向这个文件夹(也就是把他指定为根目录)

网站的身份验证方式错了。
改下就行了。
一般都用Forms

应该是配置文件有问题

打开IIS,选择你的那个web的节点,属性。查看应用程序。

如果应用程序不是你自己的那个,而是默认,或者根本就是空的话,点后面的设置应用程序,确认就可以了。。

如图