Try these, in order:
RouterModule.forRoot(routes, { onSameUrlNavigation: 'ignore' })
@Injectable({ providedIn: 'root' })
export class ManageProfileFormState {
form = this.fb.group({
userName: [''],
email: [''],
name: [''],
surname: [''],
phoneNumber: [''],
});
constructor(private fb: FormBuilder) {}
}
@Component({ /* account manage tab component */ })
export class PersonalInfoTabComponent {
form = this.state.form;
constructor(private state: ManageProfileFormState) {}
}
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
What you observe is not an ABP feature. ABP Angular apps are standard Angular SPAs. Resizing the browser (switching between desktop/mobile widths) should not reload the route or recreate your page component by itself. If your form loses state, it’s typically caused by one of these in your Angular app:
How to fix:
// app.component.ts (or any global service)
@HostListener('window:resize', ['$event'])
onResize() {
// Do NOT call location.reload() or window.location.href changes here.
// Do NOT call router.navigate(...) here just for responsive behavior.
}
RouterModule.forRoot(routes, { onSameUrlNavigation: 'ignore' })
Reference: Angular Router docs for onSameUrlNavigation.
// Keep form in a service to preserve state across template swaps
@Injectable({ providedIn: 'root' })
export class MyFormState {
form = this.fb.group({ name: [''], /* ... */ });
constructor(private fb: FormBuilder) {}
}
@Component({...})
export class MyPageComponent {
form = this.state.form; // bind same instance
constructor(private state: MyFormState) {}
}
Make sure no breakpoint observer or theme code triggers navigation:
Quick checklist:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Goal: https://localhost:44320/api/auth should be the app’s base URL. Key rule: When you use app.UsePathBase("/api/auth"), every incoming request path and every generated URL must include /api/auth.
Apply these steps to your HttpApi.Host:
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UsePathBase("/api/auth");
app.UseRouting();
app.UseStaticFiles();
app.UseAbpStudioLink();
app.UseAbpSecurityHeaders();
app.UseCors();
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseDynamicClaims();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
// Swagger endpoint MUST include the PathBase prefix
options.SwaggerEndpoint("/api/auth/swagger/v1/swagger.json", "API");
// And make Swagger UI itself available under /api/auth/swagger
options.RoutePrefix = "api/auth/swagger";
});
app.UseConfiguredEndpoints();
}
{
"App": {
"SelfUrl": "https://localhost:44320/api/auth"
}
}
ABP uses App:SelfUrl for various generated links. If you keep it without the prefix, some URLs will be wrong.
Keep controller routes as-is You do NOT need to change [Route("api/...")] attributes or conventional controller prefixes. PathBase sits in front of the entire app, so /api/auth/api/values would be wrong. Correct request is /api/auth/api/values, which is “/api/auth” (PathBase) + “/api/values” (your controller route). Don’t double-prefix routes.
Swagger JSON endpoint path With PathBase, the JSON is served at /api/auth/swagger/v1/swagger.json. Ensure:
Anti-forgery and ABP Swagger UI script ABP’s Swagger integration injects abp.js to handle CSRF. With PathBase, the SetCsrfCookie endpoint will resolve correctly as long as App:SelfUrl and PathBase are consistent and the Swagger UI page is under the same PathBase.
If you also expose static assets under the same site Call app.UseStaticFiles() after UsePathBase so static files are served via /api/auth/… when requested from this host.
Common pitfalls that cause 404 in Swagger:
Optional (only if you must run the UI at root /swagger while API is under /api/auth):
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Where to see logs during development
How to confirm or change the file location
Increasing verbosity to capture errors
Production recommendations
Quick checklist
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Where to run the command
The command to use (Angular)
Prerequisites and configuration that affect detection
Forcing regeneration or when new endpoints are not detected
Notes for reliable results
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
A) Always run migrations + seed via DbMigrator first
B) Verify the connection string used by all processes
C) Ensure seeding is invoked if you rely on hosts (not only DbMigrator)
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
{
var seeder = context.ServiceProvider.GetRequiredService<IDataSeeder>();
await seeder.SeedAsync(); // idempotent; safe to call
}
D) Confirm your IDataSeedContributor discovery
public class MyDataSeedContributor : IDataSeedContributor, ITransientDependency
{
public async Task SeedAsync(DataSeedContext context)
{
// idempotent seeding
}
}
E) Check OpenIddict client seeding inputs
F) Ensure migrations include all module tables
G) Swagger/Angular UI missing on API
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "My API");
});
H) Make seeding resilient and repeatable
I) Quick local recovery steps
This approach aligns with common ABP conventions, but specific official documentation for every point in this exact scenario is not available.
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Apply the checklist below exactly in this order:
Trust and use HTTPS dev certificate
Ensure the HttpApiHost really runs and listens
Fix ports in Angular environment
Enable CORS for Angular origin
Use HTTPS in Angular OAuth config
Clear stale Angular dev state
Confirm application-configuration endpoint manually
Most common root causes for exactly this symptom:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
[DependsOn(/* ... */)]
public class QRSPCBaseSetServiceDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<BaseSetServiceResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/BaseSetService"); // folder with zh-Hans.json etc.
});
}
}
3) The gateway routes /api/abp/application-localization to Administration and no cache inconsistency exists (see next).
4) If dynamic localization is enabled, ensure the Language Management DB contains the resource (initial registration occurs on first start of the resource-owning service). Restarting the service re-registers resources if needed.
Caching considerations for intermittent missing resources
Why the page returns to Home every ~45 minutes
Diagnostics checklist
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
What you see is expected. When you create an ABP application with Angular UI, the CLI generates:
Those “layers” are the standard ABP solution structure for a modular, maintainable backend. The Angular app consumes the backend APIs from the HttpApi.Host. Even if you don’t touch each C# project directly, they are required for a functional backend and for features like permissions, auditing, data seeding, migrations, etc.
If you want only an Angular front-end without ABP backend projects:
Summary of recommended commands:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.