我在我的一个 silverlight 应用程序中使用 RIA 服务。我可以从我的服务中成功返回大约 500 个实体(或大约 500 kb JSON),但是在客户端失败的任何事情都失败了 - 浏览器崩溃(IE 和 Firefox)。
我可以点击以下链接并成功获取 JSON:
http://localhost:52878/ClientBin/DataService.axd/AgingReportPortal2-Web-Services-AgingDataService/GetAgingReportItems
...所以我想知道这笔交易是什么。
可以反序列化多少有限制吗?如果是这样,有没有办法增加它?我记得在为此使用 WCF 时遇到了类似的问题——我需要将 web.config 中的 maxItemsInObjectGraph 设置为更高的数字——也许我需要做类似的事情?
这是我用来获取实体的代码:
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
AgingDataContext context = new AgingDataContext();
var query = context.GetAgingReportItemsQuery();
var loadOperation = context.Load(query);
loadOperation.Completed += new EventHandler(loadOperation_Completed);
}
void loadOperation_Completed(object sender, EventArgs e)
{
// I placed a break point here - it was never hit
var operation = (LoadOperation<AgingReportItem>)sender;
reportDatagrid.ItemsSource = operation.Entities;
}
任何帮助将不胜感激 - 我已经花了几个小时试图解决这个问题,但没有发现任何有同样问题的人。
谢谢,
查尔斯