可能重複:
Why can’t it find my BasicAuthenticationModule?爲什麼它不會找到我的模塊?
我試圖創建自己實現一個基本的身份驗證。
我有存儲在我的solution\Modules
和其命名空間BasicAuthenticationModule.cs
是:
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.
我在做什麼錯在這裏?
如何爲您的程序集命名磁盤上擁有你的班級? – rene
@rene請問您能具體說明嗎? – Jason94
保存你的類的項目有一個輸出文件名,因爲它是在dll中編譯的。我懷疑dll的名稱不是BasicAuthenticationModule,但可能是Web_API或類似的東西。 – rene