System.Exception: Plugin 'Must be assigned to customer role'. Access to the path '..' is denied.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I have been working on nopCommerece 4.10 for the last couple of weeks on my local machine. it was working fine. Today, when I tried to deploy it on the server (for that I am using smarterasp.net hosting) it is not working. everything is there, DB, files etc.

here is the error log.


Application startup exception: System.Exception: Plugin 'Must be assigned to customer role'. Access to the path 'h:\root\home\anir22-001\www\excell\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
Access to the path 'h:\root\home\anir22-001\www\excell\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
---> System.Exception: Plugin 'Must be assigned to customer role'. Access to the path 'h:\root\home\anir22-001\www\excell\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied. ---> System.UnauthorizedAccessException: Access to the path 'h:\root\home\anir22-001\www\excell\Plugins\bin\Nop.Plugin.DiscountRules.CustomerRoles.dll' is denied.
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Nop.Core.Plugins.PluginManager.ShadowCopyFile(String pluginFilePath, String shadowCopyPlugFolder) in H:\VSTS\ExcellWireless\Libraries\Nop.Core\Plugins\PluginManager.cs:line 307
   at Nop.Core.Plugins.PluginManager.PerformFileDeploy(String plug, ApplicationPartManager applicationPartManager, NopConfig config, String shadowCopyPath) in H:\VSTS\ExcellWireless\Libraries\Nop.Core\Plugins\PluginManager.cs:line 214
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config) in H:\VSTS\ExcellWireless\Libraries\Nop.Core\Plugins\PluginManager.cs:line 479
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config) in H:\VSTS\ExcellWireless\Libraries\Nop.Core\Plugins\PluginManager.cs:line 515
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config) in H:\VSTS\ExcellWireless\Libraries\Nop.Core\Plugins\PluginManager.cs:line 526
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration) in H:\VSTS\ExcellWireless\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 58
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
5 years ago
Sounds like a 32-bit / 64-bit conflict on the server.

I would suggest contacting your hosting provider.
5 years ago
Just encountered the same error message. I do not advocate this for a live site but for the time being to get the dev site up an running go to the website folder (but do not click into it) and set security permissions to Everyone = Full Control.

So for example if your NOPCOMMERCE dev site is

C:\Inetpub\Websites\NOPCOMMERCE

Right click NOPCOMMERCE, select Properties, select Security, Click Add, Type Everyone, Click OK, Select Full Control for everyone, Click Ok, Click OK.

Restart your NOPCOMMERCE web site (IIS -> Right CLick the NOPCOMMERCE site -> Restart)

Site will start to work.

My guess is (at the moment I am not looking into it as I'm busy setting the site up) that the account that the Application Pool runs under most likely needs to modify rights.

edited to add:

If using a hosted provider you may need to create an account for the app pool and then give that the correct file permissions. If you using a shared app pool.. find another provider.
5 years ago
Another thing you might try is the option in appsettings.json to turn shadow copy off
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.