WinServer 2016 (Windows 10) + IIS 10 + MS Office 2010. The asp.net application cannot create and (or) save an Excel file (txt file too) in a local folder (on another disk). In this case , an existing file with the same name deletes, and in development mode (launching a project from Visual Studio 2015), the file is created and deleted. Can anyone come across this?
Permissions (Full access for all groups) for the folder in which the file is written \ deleted.
UPD 0 - File Creation Code
// Создать книгу и лист _Application excel = new Application(); Workbook wb = excel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet ws = wb.Worksheets[1]; UPD 1 - Do not roll, txt-file also does not create.
// Сохранить файл и выйти из него try { wb.SaveAs(path); File.Create(@"f:\testAutorep\234.txt"); } catch { File.Create(@"f:\testAutorep\123.txt"); } UPD 2 When creating an Excel file - an exception:
Microsoft Excel cannot open or save documents due to insufficient memory or disk space. • To free up memory, close unnecessary books or programs. • To free up disk space, delete unnecessary files from this disk.
SOLVED - https://bloglisa.ru/?p=1419 Solution: Go to the registry editor, find the HKEY_CURRENT_USER \ Software \ Microsof t \ Windows \ CurrentVersion \ Explorer \ User Shell Folders section, in this section find the “Cache” parameter and change its, for example, on c: \ temp (temp directory on the C: drive must be present). After the change, restarting the computer is not necessary.
PS If this option does not help, then try changing the environment variables (system and user) temp and tmp to c: \ temp

