I have a small web application. Which was working fine until I added two genericHandler in my application.
我对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.
I am using asp.net4.0 and C#. I am not using MVC
On local host it is working fine.
But when I am hosting the published code it is giving me the above error.
堆栈跟踪:-
[FileNotFoundException:无法加载文件或程序集'Microsoft.Web.Infrastructure,Version=1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'或其依赖项之一.系统找不到指定的文件.]
[InvalidOperationException:类型System.Web.Http.WebHost.PreApplicationStartCode上的预应用程序启动初始化方法start引发异常,并显示以下错误消息:无法加载文件或程序集'Microsoft.Web.Infrastructure,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'或其依赖项之一.系统找不到指定的文件..]
[HttpException(0x80004005):应用程序启动前初始化方法在类型系统上启动.网状物Http.网络主机.PreApplication StartCode引发异常,并显示以下错误消息:无法加载文件或程序集的Microsoft.网状物Infrastructure,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'或其依赖项之一.系统找不到指定的文件..]