且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何解决.net C#中的此错误

更新时间:2022-05-31 03:55:31

,如果您有iis7,请阅读::

http://support.gearhost.com/KB/a460/add-virtual-directory-as-application-in-iis-7.aspx [
if you have iis7 read this :

http://support.gearhost.com/KB/a460/add-virtual-directory-as-application-in-iis-7.aspx[^]


right click on your virtual directory in IIS7 and select convert to application

to run iis config tool type inetmgr.exe in run.


这可能是由于IIS上的网站具有不同继承层次上的web.config文件.如果是这样,则目录级Web.Config文件中不得定义身份验证,授权,成员资格,角色.它们必须放在应用程序级别.
This may be caused because the website on IIS is having web.config files at different heirarch levels. If it is so, the directory level Web.Config files must not have authentication, authorization,membership,roles defined in them. they must be placed at app level.


要解决此问题:

您需要确保将网站运行所在的目录配置为IIS中的应用程序.为此,您需要进入IIS并在服务器上找到您的项目文件夹,右键单击属性".在应用程序设置"下,单击创建".

并在web.config中将身份验证模式更改为无"(如果您的应用程序在不在本地计算机上的网络服务器上运行).

像这样:
For fixing this:

You need to make sure that the directory from where you website is running is configured as an application in IIS. To do this, you need to go into IIS and find your project folder on the server, right click to Properties. Under Application Settings click Create.

and Change authentication mode to ''None'' in web.config(if your application is running at a webserver not on local computer).

like this:
< authentication mode="None" />


希望对您有所帮助:)


hope it helps :)