[00:33:01 INF] Request starting HTTP/1.0 GET http://api.***.tech/api/abp/api-definition - -
[00:33:01 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController.Get (Volo.Abp.AspNetCore.Mvc)'
[00:33:01 INF] Route matched with {area = "abp", action = "Get", controller = "AbpApiDefinition", page = ""}. Executing controller action with signature Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel Get(Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController (Volo.Abp.AspNetCore.Mvc).
[00:33:01 ERR] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "对不起,在处理你的请求期间,产生了一个服务器内部错误!",
"details": null,
"data": {},
"validationErrors": null
}
[00:33:01 ERR] Given type (System.String&, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e (Parameter 'item')
System.ArgumentException: Given type (System.String&, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e (Parameter 'item')
at Volo.Abp.Collections.TypeList`1.CheckType(Type item)
at Volo.Abp.Collections.TypeList`1.Add(Type item)
at Volo.Abp.Http.Modeling.ApiTypeNameHelper.GetSimpleTypeName(Type type, ITypeList duplicateTypes)
at Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel.Create(ParameterInfo parameterInfo)
at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
at Volo.Abp.Http.Modeling.ActionApiDescriptionModel.Create(String uniqueName, MethodInfo method, String url, String httpMethod, IList`1 supportedVersions, Nullable`1 allowAnonymous, String implementFrom)
at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.AddApiDescriptionToModel(ApiDescription apiDescription, ApplicationApiDescriptionModel applicationModel, ApplicationApiDescriptionModelRequestDto input)
at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.CreateApiModel(ApplicationApiDescriptionModelRequestDto input)
at lambda_method10858(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
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 ---
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 ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
[00:33:01 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
[00:33:01 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController.Get (Volo.Abp.AspNetCore.Mvc) in 128.478ms
[00:33:01 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController.Get (Volo.Abp.AspNetCore.Mvc)'
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddAuthentication(options => { options.DefaultScheme = "Cookies"; options.DefaultChallengeScheme = "oidc"; }) .AddCookie("Cookies", options => { options.ExpireTimeSpan = TimeSpan.FromDays(365); }) .AddAbpOpenIdConnect("oidc", options => { options.Authority = configuration["AuthServer:Authority"]; options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);; options.ResponseType = OpenIdConnectResponseType.CodeIdToken; options.ClientId = configuration["AuthServer:ClientId"]; options.ClientSecret = configuration["AuthServer:ClientSecret"]; options.SaveTokens = true; options.GetClaimsFromUserInfoEndpoint = true; options.Scope.Add("role"); options.Scope.Add("email"); options.Scope.Add("phone"); options.Scope.Add("Brain"); }); }
A TIRED blazor server side application。 I think it is caused by some configuration such as CORS to call API?
<strong>@L["Roles"]</strong>: @CurrentUser.Roles.JoinAsString(", ")
Waiting for you good news!
What's the best practice of globle exception handler in Blazor Server Side application?
It seem that 'app.UseErrorPage()' is not working.
If you're creating a bug/problem report, please include followings:
Oh, I add above global features. Then I rebuild the solutions. Run ef migrations add again. still got nothing.
[DependsOn(typeof(CmsKitProDomainSharedModule))]
public class Id5DomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
Id5GlobalFeatureConfigurator.Configure();
Id5ModuleExtensionConfigurator.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<Id5DomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<Id5Resource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/Id5");
options.DefaultResourceType = typeof(Id5Resource);
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Id5", typeof(Id5Resource));
});
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.EnableAll();
});
GlobalFeatureManager.Instance.Modules.CmsKitPro(cmsKitPro =>
{
cmsKitPro.EnableAll();
});
}
public partial class AddTables_CmsKitPro_Enabled : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
PS D:\abp-change\saas-admin\src\Yee.Change.Id5.EntityFrameworkCore> dotnet ef migrations add AddTables_CmsKitPro --context Id5DbContext
Build started...
Build succeeded.
Done. To undo this action, use 'ef migrations remove'
PS D:\abp-change\saas-admin\src\Yee.Change.Id5.EntityFrameworkCore> dotnet ef database update --context Id5DbContext
Build started...
Build succeeded.
Applying migration '20220209034057_Added_Pro_Module_52534'.
Applying migration '20220209035638_AddTables_CmsKitPro'.
Done.
public partial class AddTables_CmsKitPro : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
public abstract class Id5DbContextBase<TDbContext> : AbpDbContext<TDbContext>
where TDbContext : DbContext
{
public Id5DbContextBase(DbContextOptions<TDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentityPro();
builder.ConfigureIdentityServer();
builder.ConfigureFeatureManagement();
builder.ConfigureLanguageManagement();
builder.ConfigureSaas();
builder.ConfigureTextTemplateManagement();
builder.ConfigureBlobStoring();
/* Configure your own tables/entities inside here */
//builder.Entity<YourEntity>(b =>
//{
// b.ToTable(Id5Consts.DbTablePrefix + "YourEntities", Id5Consts.DbSchema);
// b.ConfigureByConvention(); //auto configure for the base class props
// //...
//});
//if (builder.IsHostDatabase())
//{
// /* Tip: Configure mappings like that for the entities only available in the host side,
// * but should not be in the tenant databases. */
//}
builder.ConfigureCmsKitPro();
builder.ConfigureCmsKit();
}
}
[DependsOn(
typeof(Id5DomainModule),
typeof(AbpIdentityProEntityFrameworkCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(LanguageManagementEntityFrameworkCoreModule),
typeof(SaasEntityFrameworkCoreModule),
typeof(TextTemplateManagementEntityFrameworkCoreModule),
typeof(BlobStoringDatabaseEntityFrameworkCoreModule)
)]
[DependsOn(typeof(CmsKitProEntityFrameworkCoreModule))]
public class Id5EntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
Id5EfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<Id5DbContext>(options =>
{
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
context.Services.AddAbpDbContext<Id5TenantDbContext>(options =>
{
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
/* The main point to change your DBMS.
* See also Id5DbContextFactoryBase for EF Core tooling. */
options.UseSqlServer();
});
}
}