ScaffoldingServer.ReadMessages: infinite loop at EndOfStreamException
- Dominant language
- C#
- Stars
- 818
- Forks
- 260
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 10
Description
## File a bug
### Include your code
```C#
while (true)
{
try
{
var rawMessage = _reader.ReadString();
var message = JsonConvert.DeserializeObject(rawMessage);
if (ShouldStopListening(message))
{
break;
}
if (MessageHandlers != null)
{
foreach (var handler in MessageHandlers)
{
if (handler.HandleMessage(this, message))
{
break;
}
}
// No handler could handle the message.
}
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
if (!TerminateSessionRequested)
{
continue;
}
break;
}
}
```
### Include stack traces
```
w System.ThrowHelper.ThrowEndOfFileException()
w System.IO.BinaryReader.Read7BitEncodedInt()
w System.IO.BinaryReader.ReadString()
w Microsoft.VisualStudio.Web.CodeGeneration.Tools.ScaffoldingServer.ReadMessages() w /home/dell/prog/Scaffolding/tools/dotnet-aspnet-codegenerator/ScaffoldingServer.cs:wiersz 236
```
### Include provider and version information
-
Microsoft.VisualStudio.Web.CodeGeneration.Design/Microsoft.DotNet.MSIdentity version: -
1.0.0 -
Target framework: (e.g. .NET 5.0) - 6.0.1
-
Operating system: - Linux x64 5.15.8-1-default
-
IDE: (e.g. Visual Studio 2019 16.3) - 1.63.2
Contributor guide
Assessment
This issue has not been assessed yet.