Base solution for your next web application
Open Closed

Modules Not Loading (AbpModule) #1603


User avatar
0
daniel created

I've just upgraded from 0.6.x to 0.11, and hit a snag with my Module not being loaded.

I image it's related to this issue: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/729">https://github.com/aspnetboilerplate/as ... issues/729</a>, but I just can't seem to see how to fix it. The Documentation looks the same as to what is was before: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Module-System">http://www.aspnetboilerplate.com/Pages/ ... ule-System</a>

Here's a snippet of the Module code:

using Abp.EntityFramework;
using Abp.Modules;

namespace MyApp.DataMigration {

	[DependsOn(typeof(MyAppCoreModule), typeof(MyAppDataModule), typeof(AbpEntityFrameworkModule))]
	public class Migrate : AbpModule
	{
		public override void Initialize()
		{
			IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
		}

		public override void PostInitialize()
		{
			var DB = IocManager.Resolve<MyAppDbContext>();

			ImportData(DB);
		}
	}
}

Any help is appreciated!


6 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    have you seen this: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1167#issuecomment-229988957">https://github.com/aspnetboilerplate/as ... -229988957</a> and this blog post: <a class="postlink" href="http://volosoft.com/asp-net-boilerplate-v0-10-0-has-been-released/">http://volosoft.com/asp-net-boilerplate ... -released/</a>

  • User Avatar
    0
    daniel created

    Hi hikalkan,

    I have seen the git issue (not the blog post), but I'm still slightly confused as to how I now need to get modules loaded.

    Do I just call AbpBootstrapper.Create<Migrate>(); in another Startup Module?

    Or do I need to make something depend on my 'Migrate' module?

  • User Avatar
    0
    hikalkan created
    Support Team

    As I understand this is not a web application? If so, you should use new AbpBootstrapper() in somewhere. Just change it to AbpBootstrapper.Create<Migrate>().

  • User Avatar
    0
    daniel created

    In the EntityFramework project, I've just added this 'Migrate' class in there. I haven't used AbpBootsrapper before, I wasn't sure if it's a new thing I need to use to include this module.

  • User Avatar
    0
    hikalkan created
    Support Team

    No need to use it directly for web apps, never mind. But.. I still did not understand why you added a Migrator module? You have already MyAppDataModule in same assembly.

  • User Avatar
    0
    daniel created

    It's for migrating data into the old system, the file is around 3,000+ lines long! It will also eventually be removed, it just keeps it out of the way for when we need it :)

    I think what I may need to do then, is remove this as a module and call the function from MyAppDataModule