Open Closed

Various warnings following generation with ABP Suite (mainly due to the ‘using’ statements) #10891


User avatar
0
ageiter created

Hi,

in the classes generated by the ABP Suite, I’ve encountered various warnings, mainly relating to the using statements, which I’d really rather not have to suppress. Ideally, I’d like this to be generated correctly from the outset. At the moment, I have several thousand warnings in the generated code… which is rather unpleasant.

Could you please implement a fix for the following issues?

  • using statements that are sorted incorrectly (the standard sorting would probably be system namespaces first, followed by alphabetical order).
  • When the same entity is generated multiple times, a using statement is added anew each time for certain classes. (So please also test multiple generation)
  • If several references point to the same entity, its namespace is included once for each reference (see screenshot below).
  • Namespaces are included that aren’t needed at all (unused)

Perhaps it would be possible to run “Remove and sort usings” (Ctrl + R, Ctrl + G) at the end for each generated class? I’m currently doing this across the whole solution, but it’s obviously tedious to have to repeat this every time after generation.

I'm using ABP Studio 3.06.

Here are some examples:

CS0105: The using directive for 'Bpo.Kontakte' appeared previously in this namespace

SA1208: Using directive for 'System' should appear before directive for 'Bpo.Npk'

SA1210: Using directives should be ordered alphabetically by the namespaces

Miscellaneous:

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

No answer yet!
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.8.0-preview. Updated on September 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.