Step 1- Add new WCF service in your project
Step 2- Web.config Settings
Add following settings in your Web.Config file.
Step 3-Create new class for generic List Extensions for Data Output to Formatted String, CSV File, and Excel
All necessary comments are attached or code lines are self-explainable. The List
Step 4- Add new folder in directory tempfiles
Step 5- Add new method in Service Method
Step 6- Add following code in IService class
That's it your WCF service is ready to download file. Call your WCF service & CSV file will download.