-
Notifications
You must be signed in to change notification settings - Fork 29
Using Pure.DI with constructor generators #21
-
I have a problem with using Pure.DI and constructors generators. During code generation constructors don't exist, so Pure.DI generates code using the default (empty) ctor. But in the meantime constructor generator generate ctor, so after that, I have compilation errors because Pure.DI code is trying to use not existing actors.
Example constructor generators that I tried:
https://github.com/distantcam/AutoCtor
https://github.com/k94ll13nn3/AutoConstructor
I had a similar problem with generating interfaces, but I could create a partial interface (without any methods) manually so it was enough to make it work.
Does anybody have any ideas about it? Does anybody try to do similar things?
I know, this is not a problem with Pure.DI (I also tried different Compile Time DI), but it is problem with a whole Code Generation (code generators cannot use code from other generators)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 1 reply
-
@konrad-gora Pure.DI generates code based on your code in the solution and references to other assemblies. It does not have access to generated code by other code generators. Otherwise, the order of generation would be critical and strange side effects would appear.
Beta Was this translation helpful? Give feedback.
All reactions
-
I understand why it doesn't work, I'm just wondering if there are some workarounds.
Beta Was this translation helpful? Give feedback.
All reactions
-
Closed as obsolete
Beta Was this translation helpful? Give feedback.