Brent
Brent

Reputation: 195

.NET 6.0 Web Api Console app exits with 4294967295 after returning FileResult

We have a .NET 6.0 Web Api Console app that contains many controllers and endpoints. They have all worked fine for over a year, as we continue developing and adding to the project.

We recently added an endpoint to download the results as a CSV file. It works, but on two of my teammate's machines (including the original developer's machine), when calling it from our Angular app or from Swagger, as soon as the file has downloaded, the api project in Visual Studio (2022) exits with code 4294967295.

I will ask the other devs to delete their local solution and all files and pull it again from Gitlab, but I'm skeptical about that fixing this because as mentioned, another developer just pulled the code down and it also shuts down for him.

Here is the code:

        [HttpGet("getScrubFile/{statisticId:long}")]
        [AuthorizeRole(AuthorizeRoleActionFilter.Daily_Schedule, AccessTypeDefinition.AccessLevel.View)]
        public FileResult GetListScrubFile(long statisticId)
        {
            return File(_listManager.GetScrubbedDataFile(statisticId), "text/csv", "scrubs.csv");
        }

Any thoughts of what else we could try or what might cause this?

EDIT: Probably the key bit of information I discovered after posting this is that if the people who have this problem run in Release mode (as opposed to Debug), the project / api does NOT shut down. So obviously this has something to do with the process and the browser communicating while debugging and the browser sending something back to the process to shut down... just don't know what, but it isn't all that important. We've moved on.

Upvotes: 1

Views: 289

Answers (0)

Related Questions