Starts in:
2 DAYS
9 HRS
40 MIN
13 SEC
Starts in:
2 D
9 H
40 M
13 S

Activities of "zhongfang"

I have read the post. May I wait the next ABP version to fix the bug?

I can give you a database connection string with email. You can create a empty ABP application with Blazor Server page. Then you can change the database connection string.

Oh, after I run the dotnet ef migrations add... The problem has been resolved.

I am very practices with ef core migrations.

Perhaps I missed any module or fuction call?

[ReplaceDbContext(typeof(IIdentityProDbContext))]
[ReplaceDbContext(typeof(ISaasDbContext))]
[ConnectionStringName("Default")]
public class BlazorOneDbContext :
    AbpDbContext<BlazorOneDbContext>,
    IIdentityProDbContext,
    ISaasDbContext
{
    /* Add DbSet properties for your Aggregate Roots / Entities here. */

    #region Entities from the modules

    /* Notice: We only implemented IIdentityProDbContext and ISaasDbContext
     * and replaced them for this DbContext. This allows you to perform JOIN
     * queries for the entities of these modules over the repositories easily. You
     * typically don't need that for other modules. But, if you need, you can
     * implement the DbContext interface of the needed module and use ReplaceDbContext
     * attribute just like IIdentityProDbContext and ISaasDbContext.
     *
     * More info: Replacing a DbContext of a module ensures that the related module
     * uses this DbContext on runtime. Otherwise, it will use its own DbContext class.
     */

    // Identity
    public DbSet<IdentityUser> Users { get; set; }
    public DbSet<IdentityRole> Roles { get; set; }
    public DbSet<IdentitySession> Sessions { get; set; }
    public DbSet<IdentityClaimType> ClaimTypes { get; set; }
    public DbSet<OrganizationUnit> OrganizationUnits { get; set; }
    public DbSet<IdentitySecurityLog> SecurityLogs { get; set; }
    public DbSet<IdentityLinkUser> LinkUsers { get; set; }
    public DbSet<IdentityUserDelegation> UserDelegations { get; }

    // SaaS
    public DbSet<Tenant> Tenants { get; set; }
    public DbSet<Edition> Editions { get; set; }
    public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; }

    #endregion

    public BlazorOneDbContext(DbContextOptions<BlazorOneDbContext> 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.ConfigureOpenIddict();
        builder.ConfigureFeatureManagement();
        builder.ConfigureLanguageManagement();
        builder.ConfigureSaas();
        builder.ConfigureTextTemplateManagement();
        builder.ConfigureBlobStoring();
        builder.ConfigureGdpr();
    ~~~

I want to create ABP application, expecially ABP module solution. I want to find out the precise package version that abp depends on.

only with Enter? the ABP framework will splict my multiple lines by Enter to get multiple URLS?

  • I delete database.
  • Then I run migrator to create database again.
  • Start HttpApi Host, Auth Server and Blazor Application.
  • My Blazor application worked very well for every razor. So I think the matter is caused by URL settings for application of Auth Server clients.

How to setup multi urls? I must add my internet address to below picture.

I think my error is caused by some configuration. I must configure my Blazor application to work with Nginx reverse proxy.

tow years ago, I use below code to let my blazor application work with Nginx reverse proxy.

#if RELEASE
            //这里的作用是:跳转到微信的登入页面时,原始网址是https而不是http
            app.Use(async (context, next) =>
            {
                context.Request.Scheme = "https";

                await next.Invoke();
            });
#endif

        app.UseAbpRequestLocalization();

It always work very well. Now I follow your link and changed above code as below.

#if RELEASE
        app.UseForwardedHeaders(new ForwardedHeadersOptions
        {
            ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
        });
#endif

        app.UseAbpRequestLocalization();

Full code is just like this:

    public override void OnApplicationInitialization(ApplicationInitializationContext context)
    {

        var app = context.GetApplicationBuilder();
        var env = context.GetEnvironment();

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

#if RELEASE
        app.UseForwardedHeaders(new ForwardedHeadersOptions
        {
            ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
        });
#endif

        app.UseAbpRequestLocalization();

        if (!env.IsDevelopment())
        {
            app.UseErrorPage();
            app.UseHsts();
            app.UseHttpsRedirection();

        }

        app.UseCorrelationId();
        app.UseStaticFiles();
        app.UseRouting();
        app.UseAbpSecurityHeaders();
        app.UseCors();
        app.UseAuthentication();
        app.UseAbpOpenIddictValidation();

        if (MultiTenancyConsts.IsEnabled)
        {
            app.UseMultiTenancy();
        }

        app.UseUnitOfWork();
        app.UseDynamicClaims();
        app.UseAuthorization();

        app.UseAuditing();
        app.UseAbpSerilogEnrichers();
        app.UseConfiguredEndpoints();
    }

After I do above changed. I got error while access OpenDict application.

error	"invalid_request"
error_description	"This server only accepts HTTPS requests."
error_uri	"https://documentation.openiddict.com/errors/ID2083"

But I still get error in Blazor application.

[12:33:13 WRN] Could not find IdentityClientConfiguration for Gitlab. Either define a configuration for Gitlab or set a default configuration.
[12:33:13 INF] Start processing HTTP request GET https://erp2api.abc.cn:222/api/gitlab/project/id?repositoryId=85&api-version=1.0
[12:33:13 INF] Sending HTTP request GET https://erp2api.abc.cn:222/api/gitlab/project/id?repositoryId=85&api-version=1.0
[12:33:14 INF] Received HTTP response headers after 168.3319ms - 200
[12:33:14 INF] End processing HTTP request after 168.6008ms - 200
Showing 1 to 10 of 120 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06