Hi Aman Agrahari,
Thank you for reaching out to Microsoft Q & A forum.
The issue you're facing occurs because the ExportToCSV library uses System.Web.HttpContext, which is no longer supported in .NET 8. This is a common limitation when migrating from .NET Framework to modern .NET versions.
To address your questions:
1.There isn’t a .NET 8-compatible version of ExportToCSV.
2.As a workaround, the library would need to be modified to remove HttpContext usage.
3.For a long-term solution, I recommend using alternatives like CsvHelper or native .NET methods (StringBuilder with File.WriteAllText) to handle CSV export in WinForms.
These options are reliable, well-supported, and align with best practices in .NET 8.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.