webconfig中的随机重复错误

时间:2015-06-08 15:53:53

标签: c# .net asp.net-web-api

我在网络服务器下的模块部分声明了一个随机名称,我收到了重复的错误消息:

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'jhgfygsdufygsdufygsdfuy2134567890hergwhegr2' 

Webconfig代码:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
  <remove name="FormsAuthentication" />
  <add name="jhgfygsdufygsdufygsdfuy2134567890hergwhegr2"  />
 </modules>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

我正在使用WebApi。

1 个答案:

答案 0 :(得分:1)

您应该先尝试添加<remove name="jhgfygsdufygsdufygsdfuy2134567890hergwhegr2">