I have installed CSV Helper on my Blazer Server App running on Azure using .NET8. When I run the app in my environment it exports to my desktop. When I publish the app and its running on Azure, The file doesn’t expert on the users pc. It seems like it is exporting to the root of Azure app services.
What is the path for any user desktop at any given time? Here is my code?
private async void Export() {
if (commModelList.Count > 0) {
outputFile = Path.Combine(Environment
.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "CommissionTotals.csv");
using var writer = new StreamWriter(outputFile);
using var csvOut = new CsvWriter(writer, CultureInfo.InvariantCulture);
csvOut.WriteRecords(commModelList);
}
else {
Error = "There is nothing to export";
}
}
,,,
I have tried to export the `.csv` when the app is running on Azure app services and the file never downloads. I have put a local variable for the FileOutPath and it comes up c:\wwwroot, which is on the azure server. I need any user allowed to export to be able to download the `.csv` file.
New contributor
user26263343 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.