我有一个使用 Entity Framework 4 构建的 Silverlight 应用程序,一堆 Silverlight 模块和一个包含我的 DomainService、Model 和 Web.Config 的 Web 项目。
我从本地 SQL Server 提取数据工作正常。我的一个 SL 模块从特定表中提取数据,当我在此表中有超过 4000 行时,应用程序崩溃并给我以下错误消息。当它有大约 1000 个鱼卵时,它工作得很好。所以,我想也许 DomainService 不能处理所有的行,或者我在 webconfig 中的绑定设置在某种程度上是错误的。我该怎么办?
错误信息:
{System.ServiceModel.DomainServices.Client.DomainOperationException:查询“LoadSiteCageData”的加载操作失败。远程服务器返回错误:NotFound。---> System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound。---> System.Net.WebException:远程服务器返回错误:NotFound。---> System.Net.WebException:远程服务器返回错误:NotFound。在 System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 在 System.Net.Browser.BrowserHttpWebRequest.<>c_ DisplayClass5.b _4(Object sendState) 在 System.Net.Browser.AsyncHelper.<>c_ DisplayClass4.b_0(Object sendState) --- 内部异常堆栈跟踪结束 --- System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) 在 System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 在 System .ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) --- 内部异常堆栈跟踪结束 --- 在 System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult) 在 System.ServiceModel System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 处的 .DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult) --- 内部异常堆栈跟踪结束 --- System.ServiceModel.DomainServices.Client.OperationBase .System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.DomainContext 的 System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error) 完成(异常错误)。 C_DisplayClass1b.b _17(对象)
网络配置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.serviceModel">
<section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings />
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
</pages>
<authentication mode="Windows" />
</system.web>
<system.codedom></system.codedom>
<system.webServer>
<modules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="MyService.Web.Service1.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<services>
<service name="MyService.Web.Service1">
<endpoint address="" binding="customBinding" bindingConfiguration="MyService.Web.Service1.customBinding0" contract="MyService.Web.Service1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>