Plugin error which i couldnt solve

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Here  is the problem, it does not have a specific time or trigger sometimes per 3 days 4 days we are getting this message

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

Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs, line 569

Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs, line 580

UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
System.IO.FileSystem.DeleteFile(string fullPath)
System.IO.File.Delete(string path)
Nop.Core.Infrastructure.NopFileProvider.DeleteFile(string filePath) in NopFileProvider.cs
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.ShadowCopyFile(INopFileProvider fileProvider, string assemblyFile, string shadowCopyDirectory) in ApplicationPartManagerExtensions.cs
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, string assemblyFile, string shadowCopyDirectory, NopConfig config, INopFileProvider fileProvider) in ApplicationPartManagerExtensions.cs
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs

Show raw exception details
Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs

Show raw exception details
Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied. Access to the path 'C:\inetpub\wwwroot\tuncproject\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, NopConfig config) in ApplicationPartManagerExtensions.cs
Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IWebHostEnvironment webHostEnvironment) in ServiceCollectionExtensions.cs
Nop.Web.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
System.RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(object instance, IServiceCollection services)
Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder+<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(object instance, IServiceCollection services)
Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder+<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
Microsoft.AspNetCore.Hosting.GenericWebHostBuilder+<>c__DisplayClass12_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
Microsoft.Extensions.Hosting.HostBuilder.Build()
Nop.Web.Program.Main(string[] args) in Program.cs

Show raw exception details
.NET Core 3.1.7 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 3.1.7    |    Microsoft Windows 10.0.14393    |   Need help?
2 years ago
hello
Did you given permission to folder of Plugins ?
Due to not given permission in IIS folder then also this issue occur

please try to give permission restart IIS and please check again
2 years ago
Full Control Permissions for IIS_IUSRS. this might help you.
https://help.campusmanagement.com/IM/Content/FB/PostInstall_IUSRSpermission.htm
2 years ago
Are you running in Visual Studio, or IIS?

Is it always for that same/one dll : Nop.Plugin.DiscountRules.CustomerRoles.dll, or does the error also show for other dlls?

After you downloaded the nopCommerce project, did you "unblock" the archive file (.zip, .rar) before extracting files?
2 years ago
I just had this error and got a response from [email protected]

This is an issue with nopCommerce. The application uses shadow copies of all the plugin DLL files in the ~/Plugins/bin directory in order for functionalities like Upload plugins and themes from the administration to work.

However, there is an issue when the application pool the store is running on has an overlapped recycling turned on. NopCommerce deletes these shadow copies every time the store restarts so it can create a new one. However, during the overlapped recycling the old process running the application pool and the new one that needs to replace it (during recycle) overlap (hence the name), and the old process still holds the shadow copies when the new one tries to delete them resulting in this concurrency.

The only known solution to this issue is to disable the Overlapped Recycle of the application pool running your store. This can be done from the advanced settings of your app pool.
2 years ago
Hi all. This is an old problem, and it has a solution for a long time, please see this comment on the main thread
2 years ago
Ok I have the problem in v4.3 so it has been fixed in v4.4 ?
2 years ago
A solution to the problem exists since version 4.20 in version 4.30, it is also there, you just need to enable the CopyLockedPluginAssembilesToSubdirectoriesOnStartup setting in the appsettings.json file, and if it does not help, then disable the UsePluginsShadowCopy setting in the same file.

Yidna wrote:
Ok I have the problem in v4.3 so it has been fixed in v4.4 ?
2 years ago
simply change ShadowCopy setting from appsetting and remove all dll files from Plugins > bin > folder
And restart application
1 year ago
Sergei-k wrote:
A solution to the problem exists since version 4.20 in version 4.30, it is also there, you just need to enable the CopyLockedPluginAssembilesToSubdirectoriesOnStartup setting in the appsettings.json file, and if it does not help, then disable the UsePluginsShadowCopy setting in the same file.

Ok I have the problem in v4.3 so it has been fixed in v4.4 ?


Try this config but can't fix the issue. Have any ide with this case? Disable Overlapped Recycling make site sometime slow and affect to our user.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.