我正在尝试创建自己的基本身份验证实现。
我已经BasicAuthenticationModule.cs
存储在 my 中solution\Modules
,它的命名空间是:
namespace Web_API.Modules
{
public class BasicAuthenticationModule : IHttpModule
我已将其添加到我的 web.config 中,如下所示:
<system.webServer>
<modules>
<add name="MyBasicAuthenticationModule" type="Web_API.Modules.BasicAuthenticationModule, BasicAuthenticationModule" />
运行此程序时出现以下错误:
Server Error in '/' Application.
Could not load file or assembly 'BasicAuthenticationModule' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'BasicAuthenticationModule' or one of its dependencies. The system cannot find the file specified.
我在这里做错了什么?