Base solution for your next web application
Open Closed

Console Application that uses ABP #1265


User avatar
0
relix3000 created

Hi! I am using ABP for a web project and I need to create a Console application that will run several separate processes. I want to use ABP services and its functionality to keep the code as simple as possible but I am having issues doing it. If any one has suggestions I'll gladly take them!


2 Answer(s)
  • User Avatar
    0
    relix3000 created

    I found this: <a class="postlink" href="https://gist.github.com/hikalkan/caf54a092c929e4c558b">https://gist.github.com/hikalkan/caf54a092c929e4c558b</a>

    But I am having no success.

  • User Avatar
    0
    relix3000 created

    THis is my Code:

    static void Main(string[] args)
            {
                using (var bootstrapper = new AbpBootstrapper())
                {
                    bootstrapper.Initialize();
                    var tester = IocManager.Instance.Resolve<Outstanding.OutstandingAppService>();
                    tester.ChangeAllDates(DateTime.Now, DateTime.Today.AddDays(2));
                }
    
            }
    
     [DependsOn(typeof(AbpZeroEntityFrameworkModule), typeof(TestCoreModule))]
            public class MyConsoleAppModule : AbpModule
            {
                public override void Initialize()
                {
                    IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
                }
            }
    
     public class DateProcessing : ITransientDependency
        {
            private readonly IOutstandingAppService _Outstanding;
    
    
            publicDateProcessing(IOutstandingAppService Outstanding)
            {
                _Outstanding = Outstanding;
            }
    

    No work. Getting : An unhandled exception of type 'System.ArgumentNullException' occurred in Abp.Zero.dll

    Additional information: Value cannot be null.