4

我们在一些客户服务器上运行 OData WCF 服务。在 .Net 3.5 上一切运行良好,但在将我们的解决方案升级到 .Net4 后,WCF 服务突然开始在随机时间间隔(通常是几天)后为所有请求返回 404。

该网站的其余部分运行正常。404 似乎是在网站重新启动后发生的。

为了让它再次工作,我们对 web.config 进行了更改。调用 HttpRuntime.UnloadAppDomain(); 无法解决问题。

我们正在尝试在本地重现该错误,但由于有时需要几天才能发生,因此重现该问题是一个困难的问题。

有什么建议么?

编辑:

这是来自服务器事件日志的错误消息:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
    <Provider Name="System.ServiceModel 4.0.0.0" />
    <EventID Qualifiers="49154">3</EventID>
    <Level>2</Level>
    <Task>5</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2012-06-02T11:15:32.000000000Z" />
    <EventRecordID>28236</EventRecordID>
    <Channel>Application</Channel>
    <Computer>xxxx-ST-001</Computer>
    <Security UserID="S-1-5-82-3945269471-185734930-3707521103-2442450153-1755958218" />
</System>
- <EventData>
    <Data>System.ServiceModel.Activation.HostedHttpRequestAsyncResult/65092316</Data>
    <Data>System.Web.HttpException (0x80004005): There was no channel actively listening at 'http://11.11.11.11/waf/services/OData.svc'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. ---> System.ServiceModel.EndpointNotFoundException: There was no channel actively listening at 'http://11.11.11.11/waf/Services/OData.svc'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)</Data>
    <Data>w3wp</Data>
    <Data>1852</Data>
</EventData>

2012 年 12 月 18 日更新: 我们能够通过确保在重新启动后对 WCF OData 服务发出的第一个站点请求来在本地重现错误。错误信息:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request.    Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(String cacheKey,   BuildResult result, Int64 hashCode, DateTime utcStart) +9508708
   System.Web.Compilation.BuildManager.CacheBuildResultInternal(String cacheKey, BuildResult result, Int64 hashCode, DateTime utcStart) +70
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9929866
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +299
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +82
   System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +29
   System.ServiceModel.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) +164
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +206
   System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598

[ServiceActivationException: The service '/ecoodata' cannot be activated due to an exception during compilation.  The exception message is: Object reference not set to an instance of an object..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +495736
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178
   System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) +348782
   System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +9663393

有人知道这可能是什么吗?

4

0 回答 0