ASP.NET MVC Excel export file format error
问题 I am currently writing an ASP.NET MVC 5 controller action to export some data to an Excel file (using some code I found here). It works...mostly. It outputs an Excel file, which I can open, but not before displaying the following error message: "The file format and extension of 'Export.xls' don't match. The file could be corrupted or unsafe. Unless you trust it's source, don't open it. Do you want to open it anyway?" I go on to select "Yes" and then it opens. I can resave it on my machine and