응용 프로그램을 사용하기 위해 IIS 사용자에게 권한을 부여해야했습니다. 64 비트 시스템을 위해 폴더 c : wind
Microsoft Interop Library : IIS8에서 Excel 통합 문서를 열 수 없습니다.
문제
다음에는 기능이 있습니다.
public static void ProcessWorkSheet(string fileName, string month, string year,
string thread)
{
//version number location
int version_row = 10;
int version_column = 2;
SeedsDBEntities db = new SeedsDBEntities();
try
{
//Instance of Excel
ExcelApp = new Microsoft.Office.Interop.Excel.Application();
ExcelApp.Visible = true;
ExcelApp.DisplayAlerts = false;
WorkBook = ExcelApp.Workbooks.Open(@fileName, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
(Microsoft.Office.Interop.Excel.Worksheet)WorkBook.Worksheets.get_Item(month);
.
.
//the rest of the code
}
Microsoft.interop 라이브러리를 사용하여 Excel 시트에서 읽고 데이터베이스에 저장하고 있습니다. 여기서 문제는 코드가 IIS 8에서 통합 문서를 여는 것을 시도 할 때 "객체 참조"예외를 가져옵니다. Visual Studio 2010에서 잘 작동합니다. 문제가 될 수 있습니다.
해결책
제휴하지 않습니다 StackOverflow