ASP.Net Com-InterOp Excel Generation issue when hosting

后端 未结 9 1366
野性不改
野性不改 2021-01-04 10:08

In my ASP.Net application I\'m generating a Excel file using MsExcel Object Libby (Com-InterOp) . The application worked fine in the VS dev. environment.

But when I

9条回答
  •  一整个雨季
    2021-01-04 10:51

    Using Office Interop on the server is NOT supported by MS - see http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

    Since Windows Vista MS introduced several security-related measures which prevent a Windows Service (IIS is just a special case of that) from doing "desktop-like" things... which means you would have to circumvent several security measures (impersonation alone won't cut it!) to get it to work (NOT recommended!).

    NOTE that the Integrated VS web server does NOT simulate the behaviour of IIS regarding permissions etc.

    To deal with Excel in a server-scenario there are several options (free and commercial) out there:

    I can recommend Aspose.Cells and Flexcel... didn't try SpreadsheetGear but hear+read lots of good things about it.

    Free options (though for xlsx format only!) are for example OpenXML 2 from MS and EPPlus.

提交回复
热议问题