Closed giuseppe-terrasi closed 1 year ago
@giuseppe-terrasi I'm not able to reproduce this, can you please provide more details on the scenario?
For reference:
@NCarlsonMSFT Thanks for your reply. I noticed that it happens only with a specific portion code of the same file. I isolated the problem inside a method containing a gRPC server streaming call with an async foreach loop.
This is the method and if I make any changes in any part of it I get the error:
private async Task LoadDataAsync()
{
try
{
var serverData = new List<Data>();
var client = new DataService.DataServiceClient(url);
var request = client.GetData(new Request());
await foreach (var data in request.ResponseStream.ReadAllAsync())
{
serverData.Add(data);
userSearchRequest.Id = session.UserId;
}
if (!string.IsNullOrEmpty(successTitle) || !string.IsNullOrEmpty(successMessage))
{
NotificationService.NotifySuccess(successTitle, successMessage);
}
}
catch(Exception ex)
{
Logger.LogError(ex, "An error occurred");
if(!string.IsNullOrEmpty(errorMessage))
{
NotificationService.NotifyError(detail: errorMessage);
}
}
}
Update: the problem seems to be related to the async foreach, the error is not present if I comment the entire foreach but it occurs even if the foreach is empty
@giuseppe-terrasi does this only repro in the case of a container, or does it also happen when running locally?
It only happens when running on a container, locally it works fine
@giuseppe-terrasi Good news: I was able to reproduce the error. Less good news: I get the same behavior when running outside a container, so I am not the person to help you 🫤.
I'll reach out to my contacts on the debugger team and see if they can help.
Tracked externally
After updating Visual Studio 2022 Community to version 17.7.3 I get this compilation error if I change the source code of a dockerized Blazor server app. If I change an HTML portion the update works well. This didn't happen with the previous version.
This is my configuration:
Thanks