Closed bveldkamp closed 3 years ago
The log mentions System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\Applications\Smtp4dev\smtp4dev\smtp4dev\appsettings.json
does that file exist?
@jafin No, Smtp4dev is installed in E:\Applications\Smtp4dev. The subfolder smtp4dev\smtp4dev does not exist, I have no idea where that comes from.
FWIW E:\Applications\Smtp4dev\appsettings.json does exist
@bveldkamp can you run the application via the exe ok and perform the save function? (outside of a hosted app pool?)
@jafin Yes, running the app standalone works, and saves settings to %APPDATA%\smtp4dev\appsettings.json
@bveldkamp I setup the app under IIS on Windows 10. I can see the same error you reported when saving settings.
This is not ideal, but if you create a subfolder smtp4dev\smtp4dev
in the smtp4dev installation then it will allow the settings to save, if the Apppool account has permission to write to that folder.
For example, I copied the distribution to c:\iis\smtp4dev
I then create the folder c:\iis\smtp4dev\smtp4dev\smtp4dev
In the app, Save settings, it should write an appsettings.json to c:\iis\smtp4dev\smtp4dev\smtp4dev\appsettings.json
The IIS AppPool executing the website must have write permission to that folder.
I think this can be tidied up a bit in the app, there should be no need for the app to have this path created.
@jafin Thanks, that is OK as a workaround. I hope this can be fixed sometime though.
When changing a setting in the web user interface and clicking Save, I get an error: Request failed with status code 500.
I checked if this could be a permission issue, and granted full permissions on the Smtp4Dev folder to the DefaultAppPool, but that didn't help.
I then used Process Monitor to see what's going on, and noticed that some non existing paths are used, e.g. E:\Applications\Smtp4dev\smtp4dev\smtp4dev.
The logfile: stdout_20210917104351_4444.log
Smtp4Dev version is win-x64-3.1.3.2 Windows is Server 2012