Skip to content

Diagnostics and Troubleshooting

Alexander Stärk edited this page Sep 25, 2026 · 1 revision

Diagnostics and Troubleshooting

Generated methods are missing

Symptoms:

  • services.RegisterServices() is not available
  • services.InitializeDependencies() is not available

Check:

  1. Basilisque.DependencyInjection is referenced.
  2. The project builds successfully.
  3. The root namespace and assembly name are valid.

Factory method diagnostics

Basilisque DI reports diagnostics for invalid factory setup:

  • BAS_DI_002: Factory method is invalid
  • BAS_DI_003: Factory method cannot be determined
  • BAS_DI_004: Provided factory method name is invalid

Typical causes:

  • non-static factory method
  • wrong return type
  • ambiguous overloads
  • missing keyed/non-keyed signature match

Extension diagnostics and behavior

If you use BAS_DI_Extensions:

  • ensure extension names exactly match generated extension method suffixes
  • ensure extension analyzers are referenced by the consuming project

Registration surprises

If a service is registered unexpectedly or with extra entries:

  • check whether attributes are inherited from interfaces/base classes
  • check ImplementsITypeName (default is true)
  • check for multiple registration attributes on the same implementation

General recommendation

When in doubt, inspect generated source output from the compiler and verify the emitted registration lines.

Clone this wiki locally