Base solution for your next web application

Activities of "hozkar"

Hi,

Im trying to create a RecurringJob with Hangfire but i dont know what should be the correct approach to achieve this.

I'm trying to define my Recurring Jobs in the Postinitialize Method of my Web Module:

var clientDomainService = IocManager.Resolve<ClientDomainService>();
RecurringJob.AddOrUpdate(() => clientDomainService.NotifyAppointment(), Cron.Minutely);

ClientDomainService inherits form DomainServiceBase, but when the recurring job executes, I got a NullReferenceException when executing this line (CurrentUnitOfWork is null):

using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))

After that, i decided to manually inject a IUnitOfWork in my domain service by its constructor, and it works; but now i noticed that i'm not able to navigate throw my entities foreign key properties: I received the following error:

Additional information: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

So, to continue with my tests i decided to include my navigation properties in the result of my repository query, but the problem now is when I query Users in the userManager i received the following exception:

Additional information: The operation cannot be completed because the DbContext has been disposed.

Could you guys please help me and tell me what is the correct approach to use my domain services methods in a recurring job?

Thanks in advance.

I am trying to create a tenant after deploying my ASP.NET Zero application to an Azure App Service instance. When I try to create it I get a backend error as shown in the image:

I deployed two app service instances and in the first one I managed to create a tenant after several attempts and errors, but in the second instance (staging) I have not been able to create it.

In my development environment (Visual Studio 2015) tenants are created with no issues.

Thanks in advance.

I'm trying to add testing to my project but when I run the default unit tests (from Zero) I got the following error in all of the tests related to application services:

Test Name: Bow.Tests.Organizations.OrganizationUnitAppService_Tests.Test_CreateOrganizationUnit Test FullName: Bow.Tests.Organizations.OrganizationUnitAppService_Tests.Test_CreateOrganizationUnit Test Source: C:\Users\Darwin\Source\Repos\BowZero\Tests\Bow.Tests\Organizations\OrganizationUnitAppService_Tests.cs : line 53 Test Outcome: Failed Test Duration: 0:00:00,001

Result StackTrace: en Abp.AutoMapper.AbpAutoMapperModule.FindAndAutoMapTypes(IMapperConfigurationExpression configuration) en Abp.AutoMapper.AbpAutoMapperModule.<CreateMappings>b__6_0(IMapperConfigurationExpression configuration) en D:\Halil\GitHub\aspnetboilerplate\src\Abp.AutoMapper\AutoMapper\AbpAutoMapperModule.cs:línea 55 en AutoMapper.MapperConfiguration.Build(Action1 configure) en AutoMapper.Mapper.Initialize(Action1 config) en Abp.AutoMapper.AbpAutoMapperModule.CreateMappings() en D:\Halil\GitHub\aspnetboilerplate\src\Abp.AutoMapper\AutoMapper\AbpAutoMapperModule.cs:línea 53 en Abp.AutoMapper.AbpAutoMapperModule.PostInitialize() en D:\Halil\GitHub\aspnetboilerplate\src\Abp.AutoMapper\AutoMapper\AbpAutoMapperModule.cs:línea 36 en Abp.Modules.AbpModuleManager.<>c.<StartModules>b__16_2(AbpModuleInfo module) en D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:línea 49 en System.Collections.Generic.List1.ForEach(Action1 action) en Abp.Modules.AbpModuleManager.StartModules() en D:\Halil\GitHub\aspnetboilerplate\src\Abp\Modules\AbpModuleManager.cs:línea 49 en Abp.AbpBootstrapper.Initialize() en D:\Halil\GitHub\aspnetboilerplate\src\Abp\AbpBootstrapper.cs:línea 138 en Abp.TestBase.AbpIntegratedTestBase1.InitializeAbp() en D:\Halil\GitHub\aspnetboilerplate\src\Abp.TestBase\TestBase\AbpIntegratedTestBase.cs:línea 42 en Abp.TestBase.AbpIntegratedTestBase1..ctor(Boolean initializeAbp) en D:\Halil\GitHub\aspnetboilerplate\src\Abp.TestBase\TestBase\AbpIntegratedTestBase.cs:línea 34 en Bow.Tests.AppTestBase..ctor() en C:\Users\Darwin\Source\Repos\BowZero\Tests\Bow.Tests\AppTestBase.cs:línea 36 en Bow.Tests.Organizations.OrganizationUnitAppService_Tests..ctor() en C:\Users\Darwin\Source\Repos\BowZero\Tests\Bow.Tests\Organizations\OrganizationUnitAppService_Tests.cs:línea 19 Result Message: System.MissingMethodException : Método no encontrado: 'Castle.Core.Logging.ILogger Abp.Modules.AbpModule.get_Logger()'.

Hi, im being trying to upgrade my app and i'm always getting the same issue.

My app was working with no problems in version 1.11.0 (this was the base version i start working) , so i decide to start upgrading it based on all the changes you did in your master branch. Everything was ok until I have to upgrade the abp nuget packages.

In my first atempt, i upgrade my nuget packages to abp v1.11.0, did all the fixes required and when i run my app, my application services were not injected by angular, and I'm always getting the following error:

"Unknown provider: abp.services.app.ubicacionProvider <- abp.services.app.ubicacion <- tenant.views.zonificacion.localidad.localidad"

That happened in all my pages with all my application services, but if i use one of your application services it worked Ok.

I checked my app services and they all implement IApplicationService and extends form AppServiceBase, same as yours.

I decided to continue upgrading to ABP version 0.11.0.2; made the required fixes, but the same problem continue.

Finally, I decided to start all over with a clean working branch of version 1.11.0 of my app and just upgrade the ABP nuget packages to version 0.11.0.2 and made only the requiered fixes (breaking changes), but I got the same problem that my app services are not injected.

Any Ideas?

Thanks in advance.

Hi, I'm trying to create some popover confirmations in my app, but i am unable to use them.

[http://keenthemes.com/preview/metronic/theme/admin_4_material_design/ui_confirmations.html])

looking at the app.js file inside the metronic theme in my web project, it looks like there is something implemented:

// Handles Bootstrap confirmations
    var handleBootstrapConfirmation = function() {
        if (!$().confirmation) {
            return;
        }
        $('[data-toggle=confirmation]').confirmation({ btnOkClass: 'btn btn-sm btn-success', btnCancelClass: 'btn btn-sm btn-danger'});
    }

I try to use it like this:

<button class="btn btn-default" data-toggle="confirmation">Confirmation</button>

but nothing happens, I also try it these way:

<button class="btn btn-default" data-toggle="confirmation" ui-jq="confirmation">Confirmation</button>

And i receive the following error:

Error: ui-jq: The "confirmation" function does not exist.

Any help?

Thanks in advance.

Hi there,

I'm trying to update my aspnetboilerplate app but i'm getting always the same error when i get to version 0.10.0.0 and i don't know what else i can do.

After updating all the aspnetboilerplate nuget packages, downgrading my EntityFramework.DynamicFilters to v1.4.11 and updating my global.asax like this:

public class MvcApplication : AbpWebApplication<BowWebModule>
    {
        protected override void Application_Start(object sender, EventArgs e)
        {
            IocManager.Instance.IocContainer.AddFacility<LoggingFacility>(f => f.UseLog4Net().WithConfig("log4net.config"));
            base.Application_Start(sender, e);
        }
    }

my app builds correctly, but in execution i got the following error:

[MissingMethodException: No hay constructor sin parámetros definido para este objeto.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +206
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.Activator.CreateInstance(Type type) +11
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +55

[InvalidOperationException: Error al intentar crear un controlador de tipo 'Bow.Web.Controllers.HomeController'. Asegúrese de que el controlador tenga un constructor público sin parámetros.]
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +178
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +76
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +88
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +194
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

It says that there is no constructor without parameters for this object; and looking at the stacktrace i think the problem is in my controllers, so I create a constructor to my HomeController without parameters (same for my AccountController).

After that I got the following error:

[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
   Abp.Web.Mvc.Controllers.AbpController.SetCurrentMethodInfoAndWrapResultAttribute(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Controllers\AbpController.cs:301
   Abp.Web.Mvc.Controllers.AbpController.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Controllers\AbpController.cs:288
   System.Web.Mvc.Controller.System.Web.Mvc.IActionFilter.OnActionExecuting(ActionExecutingContext filterContext) +10
   System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +176
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState) +58
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state) +197
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
   System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Trying to solve this issue, i start to compare my project with a new template and i found a difference in my WebModule definition:

Mine:

[DependsOn(typeof(BowDataModule), typeof(BowApplicationModule), typeof(BowWebApiModule))]
    public class BowWebModule : AbpModule
    {
          ...
    }

aspnetboilerplate template:

[DependsOn(
        typeof(Update103DataModule),
        typeof(Update103ApplicationModule),
        typeof(Update103WebApiModule),
        typeof(AbpWebSignalRModule),
        //typeof(AbpHangfireModule), - ENABLE TO USE HANGFIRE INSTEAD OF DEFAULT JOB MANAGER
        typeof(AbpWebMvcModule))]
    public class Update103WebModule : AbpModule
    {
          ...
    }

So, i add

typeof(AbpWebMvcModule)

to my WebModule.

After that, my web app start to work! , but now after I login in any of my tenants, it is unable to bring any tenant data, and in my web browser console I get this error:

abp.timing is undefined

Any Ideas?

Thanks in advance!

Hi!

When i am going to insert a record, i need to define its tenantId.

At this moment, what i am doing is to query AbpSession in my Service to obtain the TenantId of the user; then asign it to the record and save it with the aproppiate repository.

Is this the recommended approach?

Thanks in advance.

Showing 1 to 7 of 7 entries