A plugin with 'plugin.name' 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
Rename Plugin system name and dll of this folder worked in my case !!

\Presentation\Nop.Web\Plugins\plugin.json
4 years ago
I get this randomly and constantly.    several times a day.  when it happens, deleting the presentation/plugins folder fixes it.  v4.20

so anybody know WHY this happens?

it's really slowing down my development having to exit vs2019, delete folder contents, restart vs2019, rebuild all - over and over again once or twice an hour

I hate voodoo coding.  prefer to understand the "why"
4 years ago
If you created any new plugin then make sure release and build mode output folder is same.

Sometimes it different it creating same issue which you facing now.
4 years ago
Figmo wrote:
I get this randomly and constantly.    several times a day.  when it happens, deleting the presentation/plugins folder fixes it.  v4.20

so anybody know WHY this happens?

it's really slowing down my development having to exit vs2019, delete folder contents, restart vs2019, rebuild all - over and over again once or twice an hour

I hate voodoo coding.  prefer to understand the "why"


When this happens: nopCommerce differentiate all plugins by their system names. That’s why each plugin should have unique system name. If multiple plugins have same system name, system will throw this error.

How this happens: This issue can be occurred mainly for 2 reasons.

1. If you type same system name multiple times for multiple plugins.

2. Let you have 2 plugins, PluginA and PluginB. PluginA has a project reference of PluginB. When you do not set reference project copy local equal false, then Visual Studio may copy all static and binary files of PluginB into PluginA publish folder (Nop.Web > Plugins). In this way, plugin.json of PluginA will be replaced by plugin.json of PluginB and both will have the same system name.
4 years ago
1.  I have written 2 plugins and verified system name for each is unique.   all other plugins are standard nopCommerce 4.20 plugins.     if system name was duplicated in different plugins, wouldn't the error be consistent?   I can build and run many times without seeing this error.   then, suddenly- it appears.   i have not been able to notice anything different about the builds that cause this problem vs. the builds that do not.   and when it happens - it's permanent.    until I delete contents of plugins folder.  that fixes the problem.   until it happens again.   which is anywhere from 5-10 builds on average.

2. none of my plugins reference other projects.  except for the nop.web.framework project which seems to be standard.   is there a standard nopCommerce plugin that might do this?   maybe the copy local setting is wrong there.

I also get a lot of these error sometimes:
Could not copy the file "F:\My Projects\nopCommerce 4.20\src\Presentation\Nop.Web\Plugins\Tax.Avalara\web.config" because it was not found.  

the file name and plugin changes - not always the same.   doing a clean on the solution will resolve these errors.

I've never had to combine religion and coding before.  but since upgrading to vs2019 and nop 4.20....I find myself praying every time I hit the build and debug buttons.

and my prayers often go unanswered :(
4 years ago
Did you checked this in plugin csproject file?
rajupaladiya wrote:
If you created any new plugin then make sure release and build mode output folder is same.

Sometimes it different it creating same issue which you facing now.
4 years ago
Are you getting the error in Visual Studio or in you production website ?
I found one of the plugin directories will have /plugin directory inside both development and production
You need to update the Nop.Web build file with code
I replaced
  <ItemGroup>
    <Folder Include="Plugins\" />
  </ItemGroup>
with
  <ItemGroup>
    <!-- This setting fixes the problem caused by this update in the websdk in vs2019
    https://github.com/aspnet/websdk/commit/7e6b193ddcf1eec5c0a88a9748c626775555273e#diff-edf5a48ed0d4aa5a4289cb857bf46a04
    Therefore, we restore the standard configuration behavior (there was no copy to the output directory)
    in order to avoid the "Duplicate dll" error during publication.
    We can also use “ExcludeConfigFilesFromBuildOutput” according to https://github.com/aspnet/AspNetCore/issues/14017 -->
    <Content Update="**\*.config;**\*.json" CopyToOutputDirectory="Never" CopyToPublishDirectory="PreserveNewest" />
  </ItemGroup>

Clean the solution and rebuild
Then check the website runs in Visual Stuido
Then in production server stop the webserver app pool and website
Then delete all the plugins in directory and in Plugins/bin directory
And copy all the plugins from development to production server
Start  the webserver app pool and website
See if that worked
4 years ago
Only debugging.  I haven't reached the deploy phase with 4.20.   But I did verify that your  "<!-- This setting fixes the problem caused by this update in the websdk in vs2019..." setting was in the nop.web project file.

Years ago, I originally developed these plugins for nop 3.70 and never saw any of this stuff.   So I'm not sure if it's nop 4.20 or VS2019 (first time using either for me).

It's strange,  I'm just doing the normal process of "make changes/build/debug/repeat" on files in my project only - but yet I randomly get errors from other projects and other files I'm not even touching.   And just as mysteriously as they appear - they disappear by doing a clean on the solution, or deleting the presentation/plugins folder contents.  

I'm able to keep moving forward by just playing the voodoo game like I have been, but I would feel a lot more comfortable understanding.
4 years ago
Yidna wrote:
Are you getting the error in Visual Studio or in you production website ?


I am seeing the error in VS. For some reason the Nop.Web.Plugins folders are corrupt. I am finding folders that don't belong showing up, and plugin.json files from one plugin are showing up in multiple plugins. Hence the duplicate name error since the same plugin.json files are present in different plugins.
4 years ago
In Visual Studio, check the Build tab on the plugin Project.
The 'Output path' should be  ..\..\Presentation\Nop.Web\Plugins\[your plugin folder]

Also, if you are seeing core nopCommerce .dll files in your output (\Presentation\...) plugin folder, then you need to check your Dependencies and be sure 'Copy local' is  false.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.