Help! System.Exception A plugin with 'SevenSpikes.Nop.Plugins.CategoriesHeaderMenu' system name is already defined

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
OK I've burned most of the day and need help. I was just looking at existing code and restarted the webapp when this magically appeared and I'm unable to resolve it. While the exception is stating 'A plugin with 'SevenSpikes.Nop.Plugins.CategoriesHeaderMenu' system name is already defined' if I remove it I just get the same error but for another plugin. It's not always consistent as to which one it has issue with. For instance, today it is barking about and here's the messages

I've done the clean, build, whack VS temp folder and temp user folder (after shutting down VS and IISExpress) dance over and over. Tried to do that then reboot. No dice... I'm totally stuck. Can anyone provide advice on how to resolve this? Thanks in advance!
4 years ago
I faced this same error and the reason was expected, that the plugin dll was copied to individual 2 places i.e the plugin own folder and another plugin folder. Why did it happen? Because the plugin was copied from another plugin/not developed from scratch so I change the plugin system name and keep it unique but forget to change the output directory.

You can follow the below steps

1. delete all plugins from the output folder.
2. check the plugin system is unique.
3. Make sure that the plugin's output path is unique.
4. If you take reference one plugin from another make sure that it is not copied to the referred plugin folder.
5. You can clean/remove GAC, but becareful if you choose this option.
4 years ago
Thanks so much for the reply! I also saw plugins getting duplicated into OTHER plugin folders. Unfortunately, I wasn't sure how or why this happened.

I have a few questions about your response if you don't mind (I've only just started with Nop so forgive me if these are basic questions).

1. delete all plugins from the output folder.

     * Do you mean delete everything contained within the following folder $\nop\Presentation\Nop.Web\Plugins\?
     * OR do you mean delete everything from $\nop\Presentation\Nop.Web\Plugins\bin\?

2. check the plugin system is unique.

     * Do you mean the plugin name as found in $nop\Plugins\<plugin>\plugin.json?  Or is there somewhere else I need to be looking?

3. Make sure that the plugin's output path is unique.
     * Where do I find this? When I right click and view Properties within Visual Studio the output path is blank on everything.

4. If you take reference one plugin from another make sure that it is not copied to the referred plugin folder.
     * I haven't touched any plugin or plugin code so this shouldn't be an issue for me.

5. You can clean/remove GAC, but becareful if you choose this option.
     * eeeeek. OK.... but I'll save this as a last resort/nuclear option.    :)  

Thanks in advance!
4 years ago
make sure that your plugin file name is unique in the plugin.json.
Take a look the output folder(\Presentation\Nop.Web\Plugins) has a folder named plugins,if it exists,,deleted it and configure your plugin .csproj(https://docs.nopcommerce.com/developer/plugins/how-to-write-plugin_4.20.html)
if not exists,please compare your plugin .csproj file with others plugin,and notice the OutputPath,you should configure it to <OutputPath>..\..\Presentation\Nop.Web\Plugins\your plugin friendly name</OutputPath>.
About the target section,i suggest you configure it,it can help you to clean your plugin output folder.
Finally rebuild your plugin.
4 years ago
PaulSpoerry wrote:
Thanks so much for the reply! I also saw plugins getting duplicated into OTHER plugin folders. Unfortunately, I wasn't sure how or why this happened.

I have a few questions about your response if you don't mind (I've only just started with Nop so forgive me if these are basic questions).

1. delete all plugins from the output folder.

     * Do you mean delete everything contained within the following folder $\nop\Presentation\Nop.Web\Plugins\?
     * OR do you mean delete everything from $\nop\Presentation\Nop.Web\Plugins\bin\?

  =====> Delete from Presentation\Nop.Web\Plugins. If you delete from here and build again all plugin of
         solution should be copied here. But you have to bring all third party plugin(no source) here.As these plugins are not part of your core application. If you want to go deeper please see the
src\Presentation\Nop.Web.Framework\Infrastructure\Extensions InitializePlugins method and also  src\Build\src\ClearPluginAssemblies.sln

2. check the plugin system is unique.

     * Do you mean the plugin name as found in $nop\Plugins\<plugin>\plugin.json?  Or is there somewhere else I need to be looking?
      
       ===========> Yes and also Assembly name.

3. Make sure that the plugin's output path is unique.
     * Where do I find this? When I right click and view Properties within Visual Studio the output path is blank on everything.

      ============> Right click on the plugin solution and Edite the plugin 9th from the top. You will see there is a line like bellow  <OutputPath>..\..\Presentation\Nop.Web\Plugins\Courier.Carpediemmarkers</OutputPath>.

4. If you take reference one plugin from another make sure that it is not copied to the referred plugin folder.
     * I haven't touched any plugin or plugin code so this shouldn't be an issue for me.

5. You can clean/remove GAC, but becareful if you choose this option.
     * eeeeek. OK.... but I'll save this as a last resort/nuclear option.    :)  

Thanks in advance!
4 years ago
I just want to say thank you to those who provided support. For what it's worth I was NOT developing a plugin.

I followed all suggestions made by sina.islam. It did not resolve the issue but I did eventually get things resolved. After following sina.islam's advise I found an article suggesting that I delete the hidden .vs folders from within the solution. I additionally deleted everything from $\AppData\Local\Temp\ as well as $\nop\Presentation\Nop.Web\bin and $\nop\Presentation\Nop.Web\bin. This also did not resolve the problem. I've done the clean/rebuild steps a ton of times.

I'm unsure what I finally did to resolve it but the last error was saying, "A view component named 'QuickTopMenu' could not be found. A view component must be a public non-abstract class, not contain any generic parameters, and either be decorated with 'ViewComponentAttribute"... and THIS I finally recognized as it is one of only two third party plugins I had installed.

The two installed are:
* SevenSpikes.Core (required for the CategoriesHeaderMenu plugin)
* SevenSpikes.Nop.Plugins.CategoriesHeaderMenu

As soon as I saw the reference to a view component and 'QuickTopMenu' I knew where to look. This plugin has you modify \Views\Shared\_Root.cshtml in whichever theme you are using so that line 17 is changed from @await Component.InvokeAsync("TopMenu") TO @await Component.InvokeAsync("QuickTopMenu").

After changing the theme back to say just "TopMenu", cleaning and rebuilding the solution it launched and I was able to get to the site.

What's really weird is that both the "Core" plugin and $\nop\Presentation\Nop.Web\Plugins\SevenSpikes.Nop.Plugins.CategoriesHeaderMenu still exist both on my drive and within the Nop.Web plugins folder in Visual Studio.

Any ideas why that might be?  I'm only asking in case this extremely painful experience pops up again.

Again, thank you so much for your help! I really appreciate it!
4 years ago
I had the same problem when I downloaded the 4.20 source code and run it for the first time.
The problem was resolved after deleting everything contained within the following folder $\nop\Presentation\Nop.Web\Plugins\?
4 years ago
A word of advice to the developers. Before you publish this code as stable, try check out the code, build it and run it for the first time as a verification step.

For a version 4 of this product, you should not be having these first time issues.
4 years ago
vincpa wrote:
A word of advice to the developers. Before you publish this code as stable, try check out the code, build it and run it for the first time as a verification step.

For a version 4 of this product, you should not be having these first time issues.


FWIW... on download this all ran perfectly out of the box. As I've been making changes for my specific needs and testing... something went awry. I don't know that it was Nop specifically or anything I did. I don't THINK it was anything I did but I don't know for certain. I do know that on download Nop right perfectly right out of the gate.
4 years ago
sina.islam
4. If you take reference one plugin from another make sure that it is not copied to the referred plugin folder.


I am experiencing this problem. How do you ensure that it is not copying?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.