“System.IO.Stream"不包含 Windows 应用商店应用程序中“关闭"的定义 [英] 'System.IO.Stream' does not contain a definition for 'Close' in Windows Store Apps

查看:34
本文介绍了“System.IO.Stream"不包含 Windows 应用商店应用程序中“关闭"的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试在 Windows Store Apps 上构建我的 Unity 3D 项目时,出现此错误

When try to build my Unity 3D project on Windows Store Apps, this error occurs

System.IO.Stream' 不包含Close"的定义,并且找不到接受System.IO.Stream"类型的第一个参数的扩展方法Close"

System.IO.Stream' does not contain a definition for 'Close' and no extension method 'Close' accepting a first argument of type 'System.IO.Stream' could be found

如何在 Windows 8 中使用 Streams?

How can I use Streams in Windows 8?

推荐答案

您收到该错误是因为 Windows 应用商店应用不支持 Stream.Close.

You get that error because there is no support for Stream.Close on Windows Store Apps.

.Net for Windows Store 应用概览页面

托管类型和成员子集的设计明确侧重于 Windows 应用商店应用开发.因此,它省略了以下内容:

The subset of managed types and members was designed with a clear focus on Windows Store app development. As a result, it omits the following:

[...]

  • 导致混淆的成员(例如 I/O 类型的 Close 方法).

您必须将其替换为 Dispose() 或使用 using 语句.

You will have to replace that with a Dispose() or by using a using statement.

这篇关于“System.IO.Stream"不包含 Windows 应用商店应用程序中“关闭"的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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