Tôi có một ứng dụng web nhỏ. Nó hoạt động tốt cho đến khi tôi thêm hai genericHandler trong ứng dụng của mình.
Tôi đã thực hiện các thay đổi sau đây cho trình xử lý http
<system.web>
<authentication mode="Forms" >
<forms protection="All" timeout="720" defaultUrl="Default.aspx" loginUrl="Login.aspx" >
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<compilation debug="true" targetFramework="4.0" />
<httpHandlers>
<!--Code Log Handler-->
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory" />
<add verb="*" type="InfoDomeNewUI.Handler.SendOWA" path="SendOWA.ashx" />
<add verb="*" type="InfoDomeNewUI.Handler.SendSOS" path="SendSOS.ashx" />
</httpHandlers>
<customErrors mode="Off">
<error statusCode="404" redirect="Templates/PageNotFound.html" />
</customErrors>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<!--Code Log Handler-->
<add name="LogHandler1" path="SendOWA.ashx" verb="*" type="InfoDomeNewUI.Handler.SendOWA"/>
<!-- SMS SENDER-->
<add name="SendSOS" path="SendSOS.ashx" verb="*" type="InfoDomeNewUI.Handler.SendSOS"/>
</handlers>
</system.webServer>
Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Tôi đang sử dụng asp.net4.0 và C #. Tôi không sử dụng MVC
Trên máy chủ cục bộ, nó đang hoạt động tốt.
Nhưng khi tôi đang lưu trữ mã đã xuất bản, nó đang cho tôi lỗi ở trên.
Dấu vết ngăn xếp: -
[FileNotFoundException: Không thể tải tệp hoặc lắp ráp 'Microsoft.Web.Infra Structure, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' hoặc một trong các phụ thuộc của nó. Hệ thống không thể tìm thấy tệp được chỉ định.] System.Web.Http.WebHost.SuppressFormsAuthRedirectModule.Register () +0
[InvalidOperationException: Phương thức khởi tạo trước ứng dụng Bắt đầu trên loại System.Web.Http.WebHost.PreApplicationStartCode đã đưa ra một ngoại lệ với thông báo lỗi sau: Không thể tải tệp hoặc lắp ráp 'Microsoft.Web.Infra Structure, Version = 1.0.0.0, Văn hóa = trung lập, PublicKeyToken = 31bf3856ad364e35 'hoặc một trong những phụ thuộc của nó. Hệ thống không thể tìm thấy tệp được chỉ định ..] System.Web.Compilation.BuildManager.InvokePreStartInitMethods (ICollection`1 phương thức) +11708830 System.Web.Compilation.BuildManager.CallPreStartInitMethods () +465 System.Web.Hosting.Hosting ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnMTParameters hostingParameters, PolicyLevel policyLeve
[HttpException (0x80004005): Phương thức khởi tạo bắt đầu ứng dụng trước Bắt đầu trên loại System.Web.Http.WebHost.PreApplicationStartCode đã đưa ra một ngoại lệ với thông báo lỗi sau: Không thể tải tệp hoặc lắp ráp 'Microsoft.Web.Infraectors, Version = 1.0 .0.0, Văn hóa = trung lập, PublicKeyToken = 31bf3856ad364e35 'hoặc một trong các phụ thuộc của nó. Hệ thống không thể tìm thấy tệp được chỉ định ..] System.Web.HttpRuntime.FirstRequestInit (ngữ cảnh HttpContext) +11697760 System.Web.HttpRuntime.EnsureFirstRequestInit (ngữ cảnh HttpContext) +141 System.Web.HttpRuntime.ProcessPrxtvateerNotification wrivate context, II +4866485