Base solution for your next web application
Open Closed

WebAPI Methods are not working after merge to V11.2.1 #11311


0
LAD666 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? v11.2.1
  • What is your product type (Angular or MVC)? Angular 13
  • What is product framework type (.net framework or .net core)? .Net Core 6

If issue related with ABP Framework

  • What is ABP Framework version? 7.3 (Also I tired with 7.2)

If issue is about UI

  • Which theme are you using? Default thema
  • What are the theme settings?Default

Hello I hope you are well. I am trying to upgrated my applicationm from V9.3 to latest one. I am on ASP.Net Zero "v11.2.1" I did merging by one by. I had a lot of issue but one or other way I fixed them With this version there are a lot off changes on "aspnet-core" WebAPI services are not working now. There is some part of the error. Also I can share all error file

Thanks


ortal.DashboardCustomization.Dto.DashboardOutput GetDashboardDefinition(portal.DashboardCustomization.Dto.GetDashboardInput) on controller portal.DashboardCustomization.DashboardCustomizationAppService (portal.Application). INFO 2022-10-21 12:06:12,540 [15 ] c.Infrastructure.ControllerActionInvoker - Route matched with {area = "app", action = "GetUserDashboard", controller = "DashboardCustomization"}. Executing controller action with signature System.Threading.Tasks.Task1[portal.DashboardCustomization.Dashboard] GetUserDashboard(portal.DashboardCustomization.Dto.GetDashboardInput) on controller portal.DashboardCustomization.DashboardCustomizationAppService (portal.Application). INFO 2022-10-21 12:06:17,799 [15 ] osoft.EntityFrameworkCore.Infrastructure - Entity Framework Core 6.0.4 initialized 'portalDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.4' with options: None ERROR 2022-10-21 12:06:17,814 [15 ] Mvc.ExceptionHandling.AbpExceptionFilter - There is no setting defined with name: App.DashboardCustomization.Configuration.Angular.DraasDashboard Abp.AbpException: There is no setting defined with name: App.DashboardCustomization.Configuration.Angular.DraasDashboard at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name) at Abp.Configuration.SettingManager.GetSettingValueInternalAsync(String name, Nullable1 tenantId, Nullable1 userId, Boolean fallbackToDefault) at portal.DashboardCustomization.DashboardCustomizationAppService.GetDashboardWithAuthorizedWidgets(String application, String dashboardName) in D:\CreativeITC\zeno-v2\aspnet-core\src\portal.Application\DashboardCustomization\DashboardCustomizationAppService.cs:line 221 at portal.DashboardCustomization.DashboardCustomizationAppService.GetUserDashboard(GetDashboardInput input) in D:\CreativeITC\zeno-v2\aspnet-core\src\portal.Application\DashboardCustomization\DashboardCustomizationAppService.cs:line 32 at lambda_method2341(Closure , Object ) 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, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state,

/******************************* After Long Search****************** ***************/ Hi, I think, found the main reason of the problem at previous version "GetSettingName" method was like below

namespace portal.DashboardCustomization { [AbpAuthorize] public class DashboardCustomizationAppService : portalAppServiceBase, IDashboardCustomizationAppService {..... public string GetSettingName(string application) { return AppSettings.DashboardCustomization.Configuration + "." + application; }

 but in new version it is like this

/******************** V11.2.1**// public string GetSettingName(string application, string dashboardName) { return AppSettings.DashboardCustomization.Configuration + "." + application + "." + dashboardName; }

the problesm is there is not any record in "AbpSettings" table for new syntact . The old settings is like that "App.DashboardCustomization.Configuration.Angular"

How I will create new settings for existing tenats according new method ?

Regards


2 Answer(s)
  • 0
    musa.demir created

    Hi @LAD666

    Can you please also update AppSettingProvider. Here is the pull-request that we implement that changes. https://github.com/aspnetzero/aspnet-zero-core/pull/4295/files#diff-f3a21f5a48c63bb08cb9d65f0ff8f9443148d09c3051bff7aaeee526d5fd58ccR605-R608

    As you see here it now uses dashboard name to save settings.

  • 0
    LAD666 created

    Hi, Thank you for the quick response. Regarding the method input changes. I can not call my custome dashboards with new version. The application is giving errors like below

    It is looking a setting defination with this name "App.DashboardCustomization.Configuration.Angular.BaasDashboard" . There is not data like this in "[dbo].[AbpSettings]" table How can I create the data? Note: BaasDashboard is my custome dashboard

    Best Regards

    INFO 2022-10-25 14:13:28,438 [14 ] osoft.EntityFrameworkCore.Infrastructure - Entity Framework Core 6.0.4 initialized 'portalDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.4' with options: None ERROR 2022-10-25 14:13:28,450 [9 ] Mvc.ExceptionHandling.AbpExceptionFilter - There is no setting defined with name: App.DashboardCustomization.Configuration.Angular.BaasDashboard Abp.AbpException: There is no setting defined with name: App.DashboardCustomization.Configuration.Angular.BaasDashboard at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name) at Abp.Configuration.SettingManager.GetSettingValueInternalAsync(String name, Nullable1 tenantId, Nullable1 userId, Boolean fallbackToDefault) at portal.DashboardCustomization.DashboardCustomizationAppService.GetDashboardWithAuthorizedWidgets(String application, String dashboardName) in D:\CreativeITC\zeno-v2\aspnet-core\src\portal.Application\DashboardCustomization\DashboardCustomizationAppService.cs:line 223 at portal.DashboardCustomization.DashboardCustomizationAppService.GetUserDashboard(GetDashboardInput input) in D:\CreativeITC\zeno-v2\aspnet-core\src\portal.Application\DashboardCustomization\DashboardCustomizationAppService.cs:line 32 at lambda_method2094(Closure , Object ) 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.