Open Closed

ABP Studio + Suite - Error on creation of project and when generating new entity #10224


User avatar
0
mhoffmeister created

Hello,

currently I am encountering some errors/problems when using the ABP Studio or Suite.

  1. Sometimes when I create a new project I get the following error message:
System.IO.IOException: The process cannot access the file 'D:\Workspace\Playground\MeinTestDemoWerk\etc\docker\containers\postgresql.yml' because it is being used by another process.
   at SafeFileHandle Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at SafeFileHandle Microsoft.Win32.SafeHandles.SafeFileHandle.Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize, UnixFileMode? unix
CreateMode)
   at SafeFileHandle System.IO.File.OpenHandle(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
   at async Task System.IO.File.WriteAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken)+Core(?)
   at async ValueTask Volo.Abp.Studio.SolutionTemplates.Pipelines.FileEntryListWriteToOutputFolderStep+<>c__DisplayClass2_0.<CreateFilesProdAsync>b__1(?)+(?) => { }
   at async Task System.Threading.Tasks.Parallel.ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body)+(?) => { }
   at async Task Volo.Abp.Studio.SolutionTemplates.Pipelines.FileEntryListWriteToOutputFolderStep.MRGtBtrKGq(SolutionBuildPipelineContext  , ITemplateConfigWithOutputFolderAndSolutionName  )
   at async Task Volo.Abp.Studio.SolutionTemplates.Pipelines.FileEntryListWriteToOutputFolderStep.ExecuteAsync(SolutionBuildPipelineContext context)
   at async Task Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.o5RtdSaMeF(List<SolutionBuildPipelineStep>  , object  )
   at async Task<string> Volo.Abp.Studio.SolutionTemplates.Pipelines.PipelinedTemplateSolutionBuilderBase.BuildAsync(SolutionBuilderContext context)
   at async Task<string> Volo.Abp.Studio.Extensions.StandardTemplates.Microservice.MicroserviceTemplateSolutionBuilder.BuildAsync(SolutionBuilderContext context) x 2
   at async Task<string> Volo.Abp.Studio.SolutionTemplates.SolutionBuilder.BuildAsync(SolutionBuilderContext context)
   at async Task<string> Volo.Abp.Studio.UI.ViewModels.NewSolution.NewSolutionWizardWindowViewModel.bk1BnEdHpk()
   at async Task Volo.Abp.Studio.UI.ViewModels.NewSolution.NewSolutionWizardWindowViewModel.WotBH8Vljk()
   at T System.Reactive.Subjects.AsyncSubject<T>.GetResult()
   at async Task Volo.Abp.Studio.UI.ViewModels.NewSolution.NewSolutionWizardWindowViewModel.INX2VjGWNY()

It's not always blocked by another process but when it creates the new project I am not entirely sure wether all files were created correctly or still blocked by another process. I've created the project with the following options:

| Category | Option | Value | | -------- | ------ | ----- | | Solution Template | Template | Microservice | | Solution Properties | Create solution folder | true | | Database Provider | Provider | Entity Framework Core | | Database Configurations | Database management system | PostgreSQL | | Multi-Tenancy | Enable Multi-Tenancy | true | | UI Framework | Framework | MVC / Razor Pages | | Mobile Framework | Framework | None | | Public Website | Add a Public website application to the solution | false | | Dynamic Localization | Dynamic localization | true | | Optional Modules | Audit Logging | true | | Optional Modules | GDPR | true | | Optional Modules | OpenIddict UI | true | | Optional Modules | Chat | true | | Optional Modules | File Management | true | | Optional Modules | Text Template Management | true | | UI Theme | Theme | LeptonX | | UI Theme | Layout | Top menu | | UI Theme | Theme style | System | | Language Selection | Default Language | English | | Language Selection | Localizable User Interface | true | | Language Selection | Available Languages | English and German (Germany) | | .NET Aspire | Enable .NET Aspire | true | | Additional Options | Unit / Integration Test Projects | true | | Additional Options | Social Logins | false | | Additional Options | Kubernetes Configuration | false | | Additional Options | Grafana Dashboard | true | | Additional Options | Run the initial tasks | true | | Additional Services | Do you want to add additional microservices? | true | | Additional Services | Service Name | ProcessService |

  1. At the creation of the new project I added a new microservice. When I edit the microservice with the ABP Suite to add new entities and I try to "save and generate" it, the project can't be built.
Error occurred on DB migration step! Make sure the project is compiled and working. Command output: Build started...
Build failed. Use dotnet build to see the errors.

In the microservice project in the ProcessServiceDbContext.cs this first line was added, which symbol cannot be resolved:

using MeinTestDemoWerk.ProcessService.Processes;

Once I delete this line, the project looks fine but when I "save and generate" in the ABP Suite again, the line is being added again. I tried finding the specific template which might add this line but I wasn't able to find it.

Are there maybe any know issues for both problems or are there some configurations I have to adjust?

Versions:

| Software/Tool | Version | | ------------- | ------- | | ABP Studio | 2.1.3 | | ABP Suite | 10.0.1 | | ABP CLI | 2.1.3 | | PostgreSQL | 16 | | System | Windows Server 2022 | | .NET SDK | 10 |


1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Project creation error (file in use: etc/docker/containers/postgresql.yml)

    Cause

    • During Microservice solution generation, ABP Studio writes many files in parallel (Parallel.ForEachAsync). On Windows, some antivirus/indexer tools (Defender, 3rd‑party AV, cloud sync), or Explorer/Editor plugins can briefly lock newly created files, which can lead to intermittent IOException “file is being used by another process” when Studio tries to write docker files (e.g., postgresql.yml).

    Fix/Workarounds

    • Exclude the solution root from antivirus and real‑time indexers (Windows Defender, 3rd‑party AV, OneDrive/Dropbox/Google Drive sync, corporate DLP).
    • Avoid opening the target folder in Explorer/IDE while creation is running.
    • Create to a short local path (e.g., C:\Dev\MySolution) to avoid long paths/slow sync.
    • Re-run the creation once; Studio is idempotent for file writes and will complete remaining files if the lock disappears.
    • If it still recurs, temporarily disable “Run the initial tasks” and run them after creation completes from Studio or CLI; this reduces concurrent activity while files are being generated.
    1. ABP Suite generation breaks Microservice build (unresolved using MeinTestDemoWerk.ProcessService.Processes in ProcessServiceDbContext)

    Cause

    • Suite generated an import to the domain namespace where your new entity should reside (e.g., MeinTestDemoWerk.ProcessService.Processes). This happens when the entity was configured under a specific namespace/Module name in Suite, but the physical file of the entity wasn’t created in that namespace/project (or the project didn’t compile before migration), so the DbContext import points to a non-existing namespace.

    Checklist to fix

    • Ensure the entity class exists in the Domain project under the same namespace Suite expects:
      • Project: MeinTestDemoWerk.ProcessService.Domain

      • Folder: Processes

      • File example: using Volo.Abp.Domain.Entities.Auditing;

        namespace MeinTestDemoWerk.ProcessService.Processes { public class Process : FullAuditedAggregateRoot<Guid> { public string Name { get; set; } // other props... } }

    • Ensure the Entity Framework Core project references the Domain project:
      • MeinTestDemoWerk.ProcessService.EntityFrameworkCore -> reference -> MeinTestDemoWerk.ProcessService.Domain
    • Make sure your ProcessServiceDbContext has the correct model configuration:
      • Add DbSet if needed: public DbSet<Process> Processes { get; set; }
      • In OnModelCreating: builder.Entity<Process>(b => { b.ToTable(ProcessServiceDbProperties.DbTablePrefix + "Processes", ProcessServiceDbProperties.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); });
    • Verify namespace consistency:
      • If Suite shows “Root Namespace” or “Entity Namespace” as MeinTestDemoWerk.ProcessService.Processes, keep the entity file’s namespace identical.
      • If you prefer a different namespace, update it in Suite’s Entity settings before Save & Generate so Suite won’t re-add the old using line.
    • Build once before running Suite migration:
      • dotnet build MeinTestDemoWerk.ProcessService.sln
      • Fix any compile errors; Suite’s migration step runs dotnet build and fails otherwise.
    • Clean and regenerate if it got out of sync:
      • Close IDEs; run: dotnet clean dotnet restore dotnet build
      • Then in Suite, open the Microservice, Save & Generate again.

    Notes

    • Suite’s “Save & Generate” will re-insert the using based on the configured entity namespace. The correct fix is to align the entity’s actual namespace and project structure with what Suite expects, not just deleting the using.
    • If you added the microservice during solution creation, ensure its module projects are loaded and compile independently (Domain, Application, EFCore). Run migrations only after a successful build.
    1. Environment/version notes
    • Your .NET SDK shows “10”. ABP 10.x supports .NET 8/9 (and newer as released), but ensure your solution’s TargetFrameworks match the generated ones. Having only a .NET “preview” SDK without the intended target may break builds. Verify global.json (if present) and installed SDKs with dotnet --list-sdks.
    • PostgreSQL 16 is supported with EF Core provider; ensure the Npgsql packages match ABP’s version requirements (the generated solution manages this).

    If issues persist

    • Generate a minimal microservice (no Aspire, fewer optional modules) to see if the file lock disappears; this helps determine if locks are due to extra assets (Aspire/docker) created in parallel.
    • Share the exact entity definition you created in Suite (name, folder/namespace set in Suite) and confirm the entity file exists in the Domain project under that namespace; mismatches there are the typical reason for the unresolved using line.

    Sources

    • ABP Studio overview
      • https://docs.abp.io/en/abp/latest/Studio/overview
    • ABP Suite overview
      • https://docs.abp.io/en/abp/latest/Suite/index
    • ABP Module System
      • https://abp.io/docs/latest/framework/architecture/modularity/basics

    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.

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 v10.1.0-preview. Updated on December 16, 2025, 09:09
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.