该流不支持搜索操作 [英] This Stream Does Not Support Seek Operations

查看:226
本文介绍了该流不支持搜索操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个后续:<一href=\"http://stackoverflow.com/questions/6295359/getting-started-with-asp-net-mvc3-google-checkout-take-2\">Getting入门ASP.NET MVC3&安培;谷歌结帐:取2

看来,为什么我得到一个错误的请求(400错误)问题 - 请参考上面的主题 - 是因为这个错误的。结帐下面的屏幕截图:

It seems that the problem why I'm getting a Bad Request (400 error) - refer to the topic above - is because of this error. Checkout the screen shot below:

因此​​,大家可以看到,有被抛出一个异常,这可能是什么导致所有的烂摊子。我试图用一个的MemoryStream ,但我得到一个异常告诉我说不能投了 System.Net.ConnectStream 来一的MemoryStream 。那么,如何解决这个问题?

So as you can see, there's an exception being thrown and that's probably what's causing all the mess. I tried using a MemoryStream but I got an exception telling me that it cannot cast a System.Net.ConnectStream to a MemoryStream. So how can I solve this problem?

推荐答案

这是一个虚假的领先。忽略。你只看到,由于调试器/ Visualiser的试图向你展示所有属性(其中一些没有意义未知长度的流)。

That is a false lead. Ignore that. You are only seeing that because of the debugger / visualiser trying to show you all the properties (some of which don't make sense for a stream of unknown length).

这是说,我不知道它是如何有意义的补充,流视图的数据。流是的管道的,不是的水桶的。除了少数例外,他们实际上并不持有该数据 - 他们只是中介机构的数据源/汇

That said, I'm not sure how it makes sense to add that stream to view-data. Streams are pipes, not buckets. With a few exceptions they don't actually hold the data - they are just intermediaries to a data source / sink.

在找到一个实际的问题方面,需要是在code发生实际的异常。忽略任何你在Visualiser的看;这不是你的code使用的东西。

In terms of finding an actual problem, you need to catch the actual exception that is happening in the code. Ignore anything you see in the visualiser; that is not what your code uses.

我的犯罪嫌疑人的这一连接流(我不熟悉)拟用作汇 - 意思是:你写吧。然而,序列化(用于查看数据)它可能会尝试的阅读的它。这只是假设,但是,除非您指示实际的异常,你的code是提高(忽略Visualiser的)。

I suspect this "connect" stream (I'm not familiar) is intended to be used as a sink - meaning: you write to it. However, to serialize (for view-data) it might be trying to read it. This is just supposition, however, unless you indicate the actual exception that your code is raising (ignoring the visualiser).

这篇关于该流不支持搜索操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆