question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem in using FolderPlugInSource

See original GitHub issue

I’ve a multi module system and I’m migrating it to ABP v0.10.1.2. I’m facing the below issue.

Component Abp.AutoMapper.AbpAutoMapperModule could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.

Stack Trace: 

[ComponentRegistrationException: Component Abp.AutoMapper.AbpAutoMapperModule could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.]
   Castle.MicroKernel.SubSystems.Naming.DefaultNamingSubSystem.Register(IHandler handler) +579
   Castle.MicroKernel.DefaultKernel.AddCustomComponent(ComponentModel model) +55
   Castle.MicroKernel.DefaultKernel.Register(IRegistration[] registrations) +69
   Castle.Windsor.WindsorContainer.Register(IRegistration[] registrations) +46
   Abp.Modules.AbpModuleManager.RegisterModules(ICollection`1 moduleTypes) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:127
   Abp.Modules.AbpModuleManager.LoadAllModules() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:72
   Abp.AbpBootstrapper.Initialize() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\AbpBootstrapper.cs:138
   HammadSystem.Web.MvcApplication.Application_Start(Object sender, EventArgs e) in D:\src\HammadSystem\src\HammadSystem.Web\Global.asax.cs:21

[HttpException (0x80004005): Component Abp.AutoMapper.AbpAutoMapperModule could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +544
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Component Abp.AutoMapper.AbpAutoMapperModule could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +716

The system core modules dlls plus Abp dlls are located in the bin Folder The System modules are located in modules folder and because it depend on abp and the some of the core system modules the dlls are also copied in this folder. I’ve added this section in the web.config

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin;modules"/>
       <dependentAssembly>.....
 </assemblyBinding>

Before adding this section, This system wan’t able to load the dlls that my plug in depends on. Am I doing something wrong? Thanks,

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
hikalkancommented, Oct 27, 2016

One another option may be AppDomain.AssemblyResolve Event (https://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve(v=vs.110).aspx). ABP can register to this event and check plugin folders for unknown assemblies.

1reaction
mhascakcommented, Aug 28, 2016

Thanks, I use this fo .NET CORE:

/// <binding AfterBuild='copy-modules' />
"use strict";

var gulp = require('gulp')  
var clean = require('gulp-clean');

var paths = {
    devModules: "../Modules/",
    hostModules: "./Modules/"
};

var modules = [
    'CMS/Fibit.SmartWeb.Module.CMS'
];

gulp.task('clean-module', function () {
    return gulp.src([paths.hostModules + '*'], { read: false })
    .pipe(clean());
});


gulp.task('copy-modules', ['clean-module'], function () {
    modules.forEach(function (module) {
        gulp.src([paths.devModules + module + '/Views/**/*.*', paths.devModules + module + '/wwwroot/**/*.*'], { base: module })
            .pipe(gulp.dest(paths.hostModules + module));
        gulp.src([paths.devModules + module + '/bin/Debug/net461/Fibit*.*', "!"+ paths.devModules + module + '/bin/Debug/net461/Abp*.*'])
            .pipe(gulp.dest(paths.hostModules + module + '/bin'));
    });

});

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugin does not preserve folder structure source vs ...
basically under 'sources/images' I have additional folders named svg and favicon. v3.0.0+ using cpy doesn't create those subfolders in the ...
Read more >
Source code not shown when using folders plugin
The source can be viewed locally, but then the project have to be cloned and built locally. With the folder plugin, there are...
Read more >
Unable to use Intellij with a generated sources folder
I'm using Maven (SpringBoot application) solution is: Right click project folder; Select Maven; Select Generate Sources And Update Folders.
Read more >
QGIS Plugin folder names mixup
After uploading the plugin to the QGIS repository, in the end the folder names were not a problem and the issue solved itself....
Read more >
SketchUp 2019 + plugins from external sources problem
It sounds like the actual location of the Plugins folder (target) becomes only resolved when an event triggers it (like installation of an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found