ERROR: An error occurred when writing to the output stream.

Kim Strasser 816 Reputation points
2024-07-16T11:36:33.8033333+00:00

My iOS game gets always terminated when I try to debug it on my iPad OS version 17.5.1. I use Visual Studio Community 2022 (64-bit) Version 17.10.4 on my Windows 11 laptop. My iPad is connected to my iMac and I paired my iMac with VS.

When I click on the debug button in VS then it takes longtime(maybe a few minutes) until I see my game´s launch screen on my iPad and then suddenly my game gets terminated. Why is my game terminated?

My game works normally when I open the installed application on my iPad, but then I cannot use the debugger.

Resolved pending breakpoint at 'MyViewController.cs:44,1' to void ProjectiOS.MyViewController.ViewDidLoad () [0x000ad]. Resolved pending breakpoint at 'MyViewController.cs:67,1' to void ProjectiOS.MyViewController.ViewDidLoad () [0x00107]. ERROR: An error occurred when writing to the output stream. Details: Unable to read data from the transport connection: interrupted. The app has been terminated. INFO: Closing debug connection from remote debugger (TCP) INFO: Closing debug connection from device (USB) INFO: Disposing input and output streams... INFO: Disposing input and output streams... INFO: Disposing console and debugger streams... ERROR: An error occurred while writing to the debug stream. Details: Cannot access a disposed object. Object name: 'UsbStream'.

I have tried to remove the two breakpoints in MyViewController.cs and then I tried to debug again. Then I got this errror:

Resolved pending breakpoint at 'Game1.cs:6877,1' to void SharedCode.Game1.ChangeToLastandCurrentingame () [0x00001]. Resolved pending breakpoint at 'Game1.cs:6885,1' to void SharedCode.Game1.ChangeToLastandCurrentingame () [0x00070]. Thread started: <Thread Pool> #5 Thread started: .NET TP Gate #6 Thread started: <Thread Pool> #7 Thread started: <Thread Pool> #8 Thread started: <Thread Pool> #9 Resolved pending breakpoint at 'Game1.cs:9164,1' to void SharedCode.Game1.<OptionsLoad>d__1706.MoveNext () [0x000cf]. INFO: Closing debug connection from remote debugger (TCP) The app has been terminated. ERROR: An error occurred when writing to the output stream. Details: Unable to read data from the transport connection: Operation aborted. INFO: Disposing input and output streams... INFO: Closing debug connection from device (USB) INFO: Disposing console and debugger streams... ERROR: An error occurred while writing to the debug stream. Details: Cannot access a disposed object. Object name: 'UsbStream'. INFO: Disposing input and output streams...

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,186 questions
0 comments No comments
{count} votes