I am currently in the process of updating my companies applications to dotnet 5. One issue I have come up against in several applications is being able to create/generate a file.
The code below is how it was done in dotnet framework.
string output = "a very long string";
Response.Clear();
Response.ClearHeaders();
Response.AddHeader("Content-Length", output.Length.ToString());
Response.ContentType = "text/plain";
Response.AppendHeader("Content-Disposition", "attachment;filename=test.txt");
Response.Write(output);
Response.End();
I have looked around and I cannot find its equivalent in dotnet core.