问题
I've created a web application that generates and allows the user to download an Excel file, It worked fine on the Visual Studio LocalHost. After I've launched it to the IIS server everything works just fine except the Generation of the excel file. The code died the first time that he is trying to select range in the work sheet - The error is the NULL error("Object reference...") I guess it kind of permission but I couldn't find one. Any Idea?
Thanks.
回答1:
As noted in comments use of Office automation is not supported on server side, there are free open source components that can read or generate excel files, and that will work as expected even on server side :
NPOI (xls) or / and EPPlus (xlsx)
来源:https://stackoverflow.com/questions/9993595/cant-create-excel-anymore-after-use-of-iis