我正在尝试发布一个and服务,但我收到错误消息:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
我有以下详细信息:
Module DefaultDocumentModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x800700b7
Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'value' set to 'KWebService.asmx'
Config File \\?\C:\inetpub\wwwroot\KWebService\web.config
Requested URL http://localhost:80/KWebService/KWebService
Physical Path C:\inetpub\wwwroot\KWebService
Logon Method Anonymous
Logon User Anonymous
指向line:
13: <files>
14: <add value="KWebService.asmx" />
15: </files>
我已经将KWebService文件夹保存在路径C:\中。我的web.config是:
<?xml version="1.0" encoding="utf-8"?>
<!--
Pour plus d'informations sur la configuration de votre application ASP.NET, consultez
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime targetFramework="4.0" />
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="KWebService.asmx" />
</files>
</defaultDocument>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
我的IIS管理器有这个屏幕截图:
我使用的端口号是80,targetFramework=是“4.0”,在应用程序池中,我有以下版本的快照:
有人能告诉我问题的原因吗?
发布于 2021-07-07 22:15:06
出现此错误是因为您在更高级别的配置文件中有一个类似的条目。它可以在服务器或网站级别。尝试将以下内容放在web.config
文件中标记的正下方。
<remove name="KWebService.asmx" />
如果您不想放置上面的条目,那么您也可以尝试在更高级别的配置文件(如applicationhost.config
)中查找重复的条目,如果不需要,则将其从那里删除。
https://stackoverflow.com/questions/32087318
复制相似问题