Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'System.IO.Stream' does not contain a definition for 'Close' in Windows Store Apps

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

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

How can I use Streams in Windows 8?

like image 514
Vladislav Avatar asked Feb 15 '23 10:02

Vladislav


1 Answers

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

As is stated on the .Net for Windows Store apps overview page

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:

[...]

  • Members that cause confusion (such as the Close method on I/O types).

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

like image 181
Bart Avatar answered Feb 18 '23 14:02

Bart