Discount Plugin from nopCommerce Team

2 周 前
Hello;

I need help regarding a plugin error that we believe is crashing a client's nopCommerce website.

REFERENCE
Discount Plugin
Version: 1.39
Author: nopCommerce team
System name: DiscountRequirement.MustBeAssignedToCustomerRole

At least once a day, our client's website is crashing and giving this error:
HTTP Error 500.30 - ASP.NET Core app failed to start

We found the following error...

Basically, the system is looking for
C:\Virtual\example.com\www\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll

...and we don't have the dll

See details of the error below.

Application '/LM/W3SVC/2/ROOT' with physical root 'C:\Virtual\ example.com\www\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:

Unhandled exception. System.Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\Virtual\ example.com\www\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.

Access to the path 'C:\Virtual\ example.com\www\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.


---> System.Exception: Plugin 'Must be assigned to customer role'. Access to the path 'C:\Virtual\ example.com\www\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
---> System.UnauthorizedAccessException: Access to the path 'C:\Virtual\example.com\www\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.

   at System.IO.FileSystem.DeleteFile(String fullPath)

   at System.IO.File.Delete(String path)

   at Nop.Core.Infrastructure.NopFileProvider.DeleteFile(String filePath) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\NopFileProvider.cs:line 153

   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.ShadowCopyFile(INopFileProvider fileProvider, String assemblyFile, String shadowCopyDirectory) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 104

   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.PerformFileDeploy(ApplicationPartManager applicationPartManager, String assemblyFile, String shadowCopyDirectory, PluginConfig pluginConfig, INopFileProvider fileProvider) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 206

   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 503

   --- End of inner exception stack trace ---

   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 539

   --- End of inner exception stack trace ---

   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationPartManagerExtensions.InitializePlugins(ApplicationPartManager applicationPartManager, PluginConfig pluginConfig) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationPartManagerExtensions.cs:line 550

   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, WebApplicationBuilder builder) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 68

   at Program.<Main>$(String[] args) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Program.cs:line 19
1 周 前
Hi
Looks like there is a file permission issue as IIS is unable to find/read the file from the Plugins/bin directory
I would suggest you to
1. Give the application pool full access to your physical root of the application i.e "C:\Virtual\ example.com\www" directory
2. By the looks of your log, you are using Nop Version older than or equal to 4.5 so please check the appSettings.json, you can set the UsePluginsShadowCopy to false, which means the Plugins/bin directory won't be checked to load the plugins assembly. It will be loaded from the Plugins/{PluginsName} itself
1 周 前
Thank you for your reply.
We are checking the website with your suggestions.