Open Closed

Abp Suite shared error #9973


User avatar
0
yazilim.ithinka created
  • Template: microservice
  • Created ABP Studio Version: 1.3.3
  • Current ABP Studio Version: 1.3.3
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Theme Menu Placement: side
  • Run Install Libs: Yes
  • Database Provider: ef
  • Database Management System: postgresql
  • Mobile Framework: react-native
  • Public Website: Yes
  • Social Login: Yes
  • Include Tests: Yes
  • Dynamic Localization: Yes
  • Kubernetes Configuration: Yes
  • Grafana Dashboard: Yes
  • Use Local References: No
  • Aspire: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • AuditLogging
    • OpenIddictAdmin
  • Selected Languages: English, Turkish
  • Default Language: English
  • Create Command: abp new importContryProj -t microservice --ui-framework angular --mobile react-native --database-provider ef --database-management-system postgresql --theme leptonx --skip-migrator --public-website --without-cms-kit --dont-run-bundling -no-language-management -file-management

AbpSuiteVersion: ABP Suite v9.3.5

Hello, when we create an unrelation table in a sample microservice project, we do not have any problems, but when we want to add a relation table, using importContryProj.ManagementService.Shared; is added in our CountryControllerBase class, but since we have nothing related to shared, using also gives an error. Below, I am sharing the steps for creating an example. We kindly request your support


1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • The error occurs because ABP Suite is generating a using importContryProj.ManagementService.Shared; statement, but there is no Shared project or namespace in your microservice solution. In ABP microservice templates, the "Shared" project is not created by default for each service; it is only present in some monolithic or modular setups.

    • When you add a navigation property (relation) between entities in a microservice service (like ManagementService), ABP Suite expects a Shared project to exist for DTO sharing, but your solution structure does not include it. This results in the CS0234 error: The type or namespace name 'Shared' does not exist in the namespace.

    • To resolve this:

      1. Remove or comment out the using importContryProj.ManagementService.Shared; line in the generated files.
      2. If you need to share DTOs or contracts between services, create a new Shared project (e.g., importContryProj.ManagementService.Shared) and move shared DTOs/interfaces there. Then, reference this project from your other projects as needed.
      3. Alternatively, keep all contracts in the Application.Contracts project and update your usings accordingly.
    • This is a known limitation when using ABP Suite with microservice templates, as the code generator assumes a Shared project exists for each service. You may need to adjust the generated code manually or create the missing Shared project.

    Sources:

    • https://abp.io/docs/en/commercial/latest/abp-suite/index

    This approach aligns with common ABP microservice conventions, but specific official documentation for 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.

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 October 07, 2025, 05:59