为什么不能找到我的BasicAuthenticationModule? [英] Why can't it find my BasicAuthenticationModule?

查看:353
本文介绍了为什么不能找到我的BasicAuthenticationModule?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建自己实现一个基本的身份验证。

I'm trying to create my own implementation of a basic-authentication.

我有存储 BasicAuthenticationModule.cs 在我的解决方案\\模块和它的名称空间是:

I have BasicAuthenticationModule.cs stored in my solution\Modules and its namespace is:

namespace Web_API.Modules
{
public class BasicAuthenticationModule2 : IHttpModule

香港专业教育学院把它添加到我的web.config这样:

Ive added it to my web.config as such:

<system.webServer>
    <modules>
      <add name="BasicAuthenticationModule" type="Web_API.Modules.BasicAuthenticationModule, BasicAuthenticationModule"/>

运行这个让我: HTTP错误500.19 - 内部服务器错误 - 不能添加类型的重复的集合项添加以独特的键属性名称设置为BasicAuthenticationModule

有没有人有线索?

推荐答案

究其原因是因为已经有一个内置的模块名为 BasicAuthorizationModule 自带里面.NET。

The reason is because there already is a built-in module called BasicAuthorizationModule that comes inside .NET.

您将需要两种:


  • 使用不同的名称(例如 BasicAuthModule

  • 删除现有的 BasicAuthorizationModeule 模块项

  • use a different Name (e.g. BasicAuthModule)
  • remove the existing BasicAuthorizationModeule module entry

这篇关于为什么不能找到我的BasicAuthenticationModule?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆