Open Closed

Scaffold: Extra angular application with all the features, which will be created usually in ABP Studio (language, auth ....) #9394


User avatar
0
starting created

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


8 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, currently, when you have a solution, you can add a DDD module template via ABP Studio UI and select Angular UI:

    When you do that, it will create a new layered application with Angular UI. If you only want to add an angular UI, unfortunately, it's not supported yet.

  • User Avatar
    0
    starting created

    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&lt;string&gt; 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!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The library is entirely synchronous and does not offer asynchronous methods.

    I strongly suggest you use asynchronous methods instead of synchronous methods.


    1. Is using a singleton wrapper service with SemaphoreSlim the recommended approach in ABP for integrating such libraries?
    2. Are there specific considerations or best practices within ABP to ensure thread safety and proper integration in this scenario?
    3. 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

  • User Avatar
    0
    starting created

    After adding https://abp.io/support/questions/9394/Scaffold-Extra-angular-application-with-all-the-features-which-will-be-created-usually-in-ABP-Studio-language-auth I get a lot of those errors "Error NU1605: Package downgrade detected for “Microsoft.Extensions.FileProviders.Embedded” (v9.0.4 → v9.0.0). ", even if I used your abp suite to install that package and do the build graph

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can upgrade all Microsoft packages in your project to 9.0.4 to solve this.

    Thanks.

  • User Avatar
    0
    starting created

    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."

  • User Avatar
    0
    masum.ulu created
    Support Team Angular Expert

    [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 run yarn ng serve command in module project

  • User Avatar
    0
    starting created

    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:

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37