Access Denied after reloading list of plugins

1 month ago
I added a new plugin to my Plugins folder and clicked "reload list of plugins" but I get an error below. This is a custom plugin, that I don't have any issues with except whenever I try to reload the site when I add a new plugin. If I reset the application pool for my site, the error goes away. Any ideas what might be causing it?

An error occurred while starting the application.
UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\estech\Plugins\bin\Nop.Plugin.Misc.MyPlugin.dll' is denied.
System.IO.FileSystem.DeleteFile(string fullPath)

Exception: Plugin 'Export Pricing'. Access to the path 'C:\inetpub\wwwroot\estech\Plugins\bin\Nop.Plugin.Misc.MyPlugin.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs, line 569

Exception: Plugin 'Export Pricing'. Access to the path 'C:\inetpub\wwwroot\estech\Plugins\bin\Nop.Plugin.Misc.MyPlugin.dll' is denied.
Access to the path 'C:\inetpub\wwwroot\estech\Plugins\bin\Nop.Plugin.Misc.MyPlugin.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs, line 580
1 month ago
This could be due to application pool "overlapped recycling" and the "shadow copy" directory: https://www.nopcommerce.com/en/boards/topic/49851/serious-iis-application-pool-recycling-bugdesign-flaw
1 month ago
af1racing wrote:
This could be due to application pool "overlapped recycling" and the "shadow copy" directory: https://www.nopcommerce.com/en/boards/topic/49851/serious-iis-application-pool-recycling-bugdesign-flaw


Thanks, I saw that thread but somehow I missed the solution in the original post.  I just set my application pool setting Disable Overlapping Recycle = true and it works. I'm assuming there are no adverse effects of changing this setting?
1 month ago
The site will be down during recycle: https://stackoverflow.com/questions/26388833/disadvantages-and-advantages-of-disable-overlapped-recycle-of-iis

In that lengthy thread above there are also suggestions for how to disable the shadow copy of plugins instead (in plugin/bin), but I have not experimented with it.  I think either way the app pool is going to have a lock on files though.