The Excel file is not created by the application ASP.NET

WinServer 2016 (Windows 10) + IIS 10 + MS Office 2010. The app asp.net can't create and / or save an Excel file (txt file too) in a local folder (on another disk). In this case, deletes an existing file with this name, and in development mode (running the project from Visual Studio 2015), the file is created and deleted. Can who faced with similar?

enter a description of the image here

enter a description of the image here

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-It didn't work, it doesn't create a txt file either.

 // Сохранить файл и выйти из него
     try
{
    wb.SaveAs(path);
    File.Create(@"f:\testAutorep\234.txt");
}
catch
{
    File.Create(@"f:\testAutorep\123.txt");
}

UPD 2 When creating an Excel file - 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. files

SOLVED - https://bloglisa.ru/?p=1419 Solution: Go to the registry editor, find the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders section, in this section, find the "Cache" parameter and change it, for example, to c:\temp (the temp directory on the C: drive must be present). After the change, you do not need to restart the computer.

P.S. If this option does not help, try changing the environment variables (system variables). and custom) temp and tmp on c:\temp

Author: Moroz Alex, 2019-01-21

1 answers

Solution: Go to the registry editor, find the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders section, in this section, find the "Cache" parameter and change it, for example, to c:\temp (the temp directory on the C: drive must be present). After the change, you do not need to restart the computer.

P.S. If this option does not help, try changing the environment variables (system and user) temp and tmp to c:\temp

 1
Author: Moroz Alex, 2019-01-25 14:35:53