Hello ABP support,
I’m working on a multi-layered ABP solution generated with the ABP CLI and now need to add an extra standalone Angular CLI project alongside it—ideally via a single ABP CLI command or built-in feature so it works seamlessly (authentication, HTTP API proxies, theming) on the first try
Please share the solution with me, so a recommended way to scaffold and configure a second Angular application into an existing layered ABP solution out-of-the-box.
ABP Framework version: v 9.25 UI Type: Angular Database System: EF Core (SQL Server, Tiered (for MVC) or Auth Server Separated (for Angular): yes
20 Answer(s)
-
0
-
0
I'm currently developing an ABP web application, specifically working on an external module for it. As part of this, I need to integrate an external class library that has the following characteristics:
- The library is entirely synchronous and does not offer asynchronous methods.
- It is not thread-safe.
- Modifying the library's source code is not an option.
To safely incorporate this library, I've implemented a wrapper service that serializes access using SemaphoreSlim. This wrapper is registered as a singleton service and is injected into my application services.
Questions:
- Is using a singleton wrapper service with SemaphoreSlim the recommended approach in ABP for integrating such libraries?
- Are there specific considerations or best practices within ABP to ensure thread safety and proper integration in this scenario?
- Does ABP provide any built-in mechanisms or patterns to facilitate the integration of non-thread-safe, synchronous external libraries?
`public interface IThreadSafeWrapper { Task
public class ThreadSafeWrapper : IThreadSafeWrapper, ISingletonDependency { private static readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
public async Task<string> DoWorkAsync() { await _semaphore.WaitAsync(); try { // Aufruf der nicht threadsicheren Bibliothek var result = new Irgendwas().Start(); return result; } finally { _semaphore.Release(); } }
}`
and
using System.Threading.Tasks; using Volo.Abp.Application.Services;
public class MyAppService : ApplicationService { private readonly IThreadSafeWrapper _threadSafeWrapper;
public MyAppService(IThreadSafeWrapper threadSafeWrapper) { _threadSafeWrapper = threadSafeWrapper; } public async Task<string> GetResultAsync() { var result = await _threadSafeWrapper.DoWorkAsync(); return result; }
}
plus
public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddSingleton<IThreadSafeWrapper, ThreadSafeWrapper>(); }
I appreciate your guidance on this matter.Thank you!
-
0
hi
The library is entirely synchronous and does not offer asynchronous methods.
I strongly suggest you use asynchronous methods instead of synchronous methods.
- Is using a singleton wrapper service with SemaphoreSlim the recommended approach in ABP for integrating such libraries?
- Are there specific considerations or best practices within ABP to ensure thread safety and proper integration in this scenario?
- Does ABP provide any built-in mechanisms or patterns to facilitate the integration of non-thread-safe, synchronous external libraries?
ABP has some extension methods for
SemaphoreSlim
SemaphoreSlim is a basic feature, you can use it freely without considering the ABP limitation.
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Core/Volo/Abp/Threading/SemaphoreSlimExtensions.cs#L11-L134
-
0
hi
You can upgrade all
Microsoft
packages in your project to9.0.4
to solve this.Thanks.
-
0
Is it possible to start the angular project https://abp.io/support/questions/9394/Scaffold-Extra-angular-application-with-all-the-features-which-will-be-created-usually-in-ABP-Studio-language-auth (created with DDD and angular) without starting the main project where the module is installed?
...\myNewModule\angular> yarn start Results in: "yarn run v1.22.22 error Command "start" not found."
...\myNewModule\angular> ng s Results in: "Cannot determine project or target for command."
-
0
[starting] said: Is it possible to start the angular project https://abp.io/support/questions/9394/Scaffold-Extra-angular-application-with-all-the-features-which-will-be-created-usually-in-ABP-Studio-language-auth (created with DDD and angular) without starting the main project where the module is installed?
...\myNewModule\angular> yarn start Results in: "yarn run v1.22.22 error Command "start" not found."
...\myNewModule\angular> ng s Results in: "Cannot determine project or target for command."
Hi, we didn't provide angular application to module projects instead imported to host app on the root, yet you can add angular application via
ng generate application my-app
command after that runyarn ng serve
command in module project -
0
Hi,
I created an extra module using the ABP Suite, based on the approach described here: https://abp.io/support/questions/9394/Scaffold-Extra-angular-application-with-all-the-features-which-will-be-created-usually-in-ABP-Studio-language-auth
All errors were resolved, and the module was successfully installed.
However, when I try to access the module via the main application's URL, I encounter the following error:
-
0
Could you please respond?
-
0
Hello, we apologize for the delay. I’ll look into this and get back to you as soon as possible. Thank you for your patience and understanding.
-
0
To help us troubleshoot the module error you're encountering, could you please provide the following additional details:
Routing Setup
If the problem occurs on navigation, we can troubleshoot these points.
- Are you lazy-loading the module from the library?
- If yes, please share the
loadChildren
statement or the relevant part of your route configuration.
TypeScript Configuration
- Please share the contents of your application's
tsconfig.json
andtsconfig.app.json
. - If you are consuming the library locally, also include
tsconfig.base.json
(if present) and confirm whetherpaths
are being used for module resolution.
- Please share the contents of your application's
These details will help us better understand how the library is being resolved and integrated into your application.
-
0
Are you lazy-loading the module from the library?
Please share the contents of your application's
Module-project-structure:
- Template: app
- Created ABP Studio Version: 0.9.25
- Current ABP Studio Version: 1.0.0
- Tiered: Yes
- Multi-Tenancy: Yes
- UI Framework: angular
- Theme: leptonx
- Theme Style: system
- Run Install Libs: Yes
- Progressive Web App: No
- Run Progressive Web App Support: No
- Database Provider: ef
- Database Management System: sqlserver
- Separate Tenant Schema: Yes
- Create Initial Migration: Yes
- Run Db Migrator: Yes
- Mobile Framework: none
- Public Website: No
- Include Tests: Yes
- Kubernetes Configuration: Yes
- Distributed Event Bus: none
- Use Local References: No
- Optional Modules:
- GDPR
- FileManagement
- TextTemplateManagement
- LanguageManagement
- AuditLogging
- OpenIddictAdmin
-
0
Thank you for taking the time to provide these details. Upon reviewing the information, I was unable to identify any misconfiguration that could be causing the issue.
If you could share a minimal, reproducible example, I would be glad to investigate further. Please feel free to send it to me at: sumeyye.kurtulus@volosoft.com
-
0
Hello again! Apologies for the delayed response—I just got a moment to reply. Thank you for your patience and cooperation.
-
0
Hi, I wrote you
-
0
Thanks @starting
@sumeyye.kurtulus will check and reply asap.
Thanks
-
0
I didn't receive a satisfying answer, please return the credits for the entire post, even the deleted ones
-
0
[starting] said: I didn't receive a satisfying answer, please return the credits for the entire post, even the deleted ones
The question was closed by our support bot, reopenned it. @sumeyye.kurtulus will check and reply you, so please wait for answer from her. After she writes you back, if you still believe this way then we can reevaulate refunding the credit and deleting the post.
Regards.
-
0
Sure, we have an ongoing email thread, and I will be looking into it as soon as possible.
-
0
-
0
hi
Refunded. Thanks.