Silverlight 4 中的 IObservable:找不到类型或命名空间 IObservable
我在哪里可以找到这门课?我已经包含了 Rx 扩展。我已经确定我要编译的版本是 Silverlight 4。我的 VS2010 IDE 仍然不知道 IObservable 类型是什么。
我收到一个编译错误,提示“找不到类型或命名空间 IObservable”,
我没有在 System.Collections.Generic 命名空间中看到它们,就像这个线程建议的那样 http ://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions/suggestions/523437-include-iobserver-t-and-iobservable-t-interface
我是否缺少对 dll 的引用?
Where can I find this class? I have included the Rx extensions. I have made sure the version I'm compiling to is Silverlight 4. My VS2010 IDE still has no idea what the type IObservable is.
I get a compile error saying "type or namespace IObservable could not be found"
I didn't see them in the System.Collections.Generic namespace like this thread suggests
http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions/suggestions/523437-include-iobserver-t-and-iobservable-t-interface
Am I missing a reference to a dll?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它位于 System 命名空间中,类型为 IObservable。您需要从 ReactiveExtensions SDK 添加对 System.Observable.dll 的引用。
此外,虽然不是严格要求,但您可能需要添加对 System.Reactive.dll 的引用,其中包含许多可在 IObservable上操作的扩展方法。
It's in the System namespace, the type is IObservable<T>. You'll need to add a reference to System.Observable.dll from the ReactiveExtensions SDK.
Also, while not strictly required, you'll probably want to add a reference to System.Reactive.dll, which contains numerous extension methods to operate on IObservable<T>.
答案不是很长,但也没什么可说的。
Silverlight 仅使用 .NET Framework 的小子集。也就是说, IObservable 不会包含在 Silverlight 4 中
Not a very long answers, but there's not a lot to say.
Silverlight only uses a small subset of the .NET Framework. That said, IObservable isn't included in Silverlight 4 if you don't include (reference) the System.Reactive.dll