【发布时间】:2012-03-02 17:34:28
【问题描述】:
我有一个定义了自定义 httpmodule 的网络服务。我正在尝试将此 Web 服务启动到运行 IIS7 的生产服务器上,但只能使其以经典模式运行。
我已尝试移动此部分
<system.web>
<httpModules>
<add name="BasicAuthenticationModule" type="MyProject.UserAuthenticator.UserNameAuthenticator" />
</httpModules>
...
到 system.webserver 部分,如下所示:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="BasicAuthenticationModule" type="MyProject.UserAuthenticator.UserNameAuthenticator" />
</modules>
当我尝试这个 IE 时,会出现这个错误:
Config Error
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to
'BasicAuthenticationModule'
我还尝试使用以下 DOS 命令自动迁移:
appcmd migrate config "mysite/"
然后得到这个消息:
The module BasicAuthenticationModule with type "mytype" is already present in the application with a different type"", and was not migrated
我不是 IIS 专家,因此感谢任何见解。
所以经过一番研究,似乎已经有一个名为 BasicAuthenticationModule 的本机模块。我可以通过将模块重命名为“BasicCustomAuthenticationModule”来消除我的问题。这是正确的方法还是我应该删除另一种方法?
谢谢! 弗里兹
【问题讨论】:
标签: iis-7 module iis-6 httpmodule