Base solution for your next web application

Activities of "KPCS"

Hi @ismcagdas,

For existing project, in 2nd step it says,

Create an empty project from AspNet Zero website using your existing project name but select the version when you started development for your project. If you don't remember the initial AspNet Zero version you have started your project, you can check [*.Core/AppVersionHelper.cs].

How do we create empty project from AspNet Zero website?

Hi,

We would like to do this for all API calls. Our function to encrypt/decrypt is ready. Can you please suggest the best place to make the function call at both the front end side and backend?

thanks

Hi Team,

Any update?

Kind Regards, Kumar Prashant

Hi,

Please see the following link to download the project:

###############################

Steps:

  1. Extract zip
  2. Open KPCSDemo.Web.sln in visual studio and run (first Get DB Setup using migration and then run Web.Host project. This will launch swagger UI. Here API GetAllCities() can be accessed.
  3. Open KPCSDemo.Receiver.App.sln in visual studio and run KPCSDemo.Receiver.App. This will call the above Service Method and will throw the mentioned exception.

Thanks,

Kind Regards, Kumar Prashant

Please use following github link to download the code:

https://github.com/kumaresop/MyApp-ReceiverApp-Exception

Thanks,

Kind Regards, Kumar Prashant

Hi,

Please refer following link for the code of GetAllStateOrProvinceForTableDropdown:

https://prorigosoftware.sharepoint.com/Shared%20Documents/Forms/AllItems.aspx?id=/Shared%20Documents/AspNetZeroSupport&p=true&originalPath=aHR0cHM6Ly9wcm9yaWdvc29mdHdhcmUuc2hhcmVwb2ludC5jb20vOmY6L2cvRWpXRldJTTBJUFpCbXhjU1Fsc3VxbW9CaEs3ME1qcGFxR05adS00aFcxc01UZz9ydGltZT1lS0hrcnFTZDJFZw

The details of the code are:

Interface/ and Implementation/ folders containing service, interface, dtos for City which is representative code of the service/method which is consumed in ReceiverApp

In ReceiverApp/ folder the code which does dependency injection of required City services and its inner dependecies and code to call the service is present. This is where we get the exception

The code is representative and not complete code, but only the relevant part in Interfaces/ Implementation/ this is done for privacy purpose (replacing project name, namespace etc.). Also a baseservice which is extended in CitiesAppService is not included. But this looks irrelevant to problem at hand.

We have ensured that GetAllCities() work correctly from Swagger UI which does http based call to the service method. Methods like this also work equally well from Angular UI which is again http based call mechanism.

In place of GetAllStateOrProvinceForTableDropdown , ​please refer to GetAllCities(). Syntactically it is exacly same.

Thanks,

Kind Regards, Kumar Prashant

Any update?

Hi,

While integrating elsa in ASPNetZero we are getting an error. We are using following steps to setup ESLA. Please help us on solving this issue.

Steps :

  1. Added the latest Elsa package on the Web.Host Elsa Elsa.Dashboard Elsa.Persistence.EntityFrameworkCore

  2. Added Elsa home controller call in a KPCSWebHostModule public override void Initialize() { IocManager.RegisterAssemblyByConvention(typeof(ElsaProjectWebHostModule).GetAssembly());

     Register(typeof(Elsa.Dashboard.Areas.Elsa.Controllers.HomeController).GetAssembly());
     Register(typeof(Elsa.WorkflowDesigner.ViewComponents.WorkflowDesignerViewComponent).GetAssembly());
    

    }

    private void Register(Assembly assembly) { //Controller IocManager.IocContainer.Register( Classes.FromAssembly(assembly) .BasedOn<Controller>() .If(type => !type.GetTypeInfo().IsGenericTypeDefinition && !type.IsAbstract) .LifestyleTransient() );

     //Razor Pages
     IocManager.IocContainer.Register(
     	Classes.FromAssembly(assembly)
     		.BasedOn&lt;PageModel&gt;()
     		.If(type => !type.GetTypeInfo().IsGenericTypeDefinition && !type.IsAbstract)
     		.LifestyleTransient()
     );
    
     //ViewComponents
     IocManager.IocContainer.Register(
     	Classes.FromAssembly(assembly)
     		.BasedOn&lt;ViewComponent&gt;()
     		.If(type => !type.GetTypeInfo().IsGenericTypeDefinition)
     		.LifestyleTransient()
     );
    

    }

  3. Database call in a startup file

    services // Add services used for the workflows runtime. .AddElsa(elsa => elsa.AddEntityFrameworkStores<SqlServerContext>(options => options.UseSqlServer(@"Server=localhost;Database=SampleElsaDb;User=sa;Password=Local;")))

    // Add services used for the workflows dashboard. .AddElsaDashboard();

4: Error

ERROR 2020-11-04 17:53:20,889 [13 ] Mvc.ExceptionHandling.AbpExceptionFilter - Method not found: 'System.__Canon AutoMapper.IMapper.Map(System.Object)'. System.MissingMethodException: Method not found: 'System.__Canon AutoMapper.IMapper.Map(System.Object)'. at Abp.AutoMapper.AutoMapperObjectMapper.Map[TDestination](Object source) at KPCS.Sessions.SessionAppService.GetCurrentLoginInformations() in F:\ESOP\src\RuleEngine\KPCS\KPCS\src\KPCS.Application\Sessions\SessionAppService.cs:line 74 at lambda_method(Closure , Object ) at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult() at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

Hi,

We checked on ELSA roadmap and it seems to be slow in evolving. Due to this issue "Mvc.ExceptionHandling.AbpExceptionFilter - Unable to cast object of type 'Castle.Proxies.SessionAppServiceProxy' to type 'Microsoft.AspNetCore.Mvc.Controller'." is not fixed yet on release.

Which other workflow engine have you seen integrating effectively with ASPNetZero?

Thnaks,

Kind Regards, Kumar Prashant

Hi Team,

Thank you for the code. While setting up the code we have recorded following observations.

Observation 1 : Steps :

  1. Setup database for Elsa Workflow and my project database
  2. Then I compile my application and start the IIS server.
  3. Then I redirect to localhost:21021/elsa/home and it's working fine thanks for that.
  4. When I redirect to localhost:4200 that time the pop up window comes up with an error. So for debugging that error I checked my log file.

ERROR :

Mvc.ExceptionHandling.AbpExceptionFilter - Unable to cast object of type 'Castle.Proxies.SessionAppServiceProxy' to type 'Microsoft.AspNetCore.Mvc.Controller'. System.InvalidCastException: Unable to cast object of type 'Castle.Proxies.SessionAppServiceProxy' to type 'Microsoft.AspNetCore.Mvc.Controller'. at Elsa.Dashboard.ActionFilters.NotifierFilter.OnActionExecuted(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

After that, I stop my IIS server and after some time start IIS server again.

Observation 2:

  1. I redirect to localhost:21021/elsa/home it's working fine.
  2. When I redirect to localhost:4200 that time the pop up window comes up with an error. So for debugging that error I checked my log file but at this time "Castle.Proxies.SessionAppServiceProxy" error does not come. Another error come :

ERROR 2020-08-19 21:59:47,166 [11 ] .EntityFrameworkCore.Database.Connection - An error occurred using the connection to database 'KPCSDb' on server 'localhost'. ERROR 2020-08-19 21:59:47,468 [11 ] Microsoft.EntityFrameworkCore.Query - An exception occurred while iterating over the results of a query for context type 'Elsa.Persistence.EntityFrameworkCore.DbContexts.SqlServerContext'. System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.MoveNextAsync() System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.MoveNextAsync()

I think at the login screen application confuse about which database to use. Please let us know howcan we resolve this issue

Showing 11 to 20 of 22 entries