Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using Pure.DI with constructor generators #21

konrad-gora started this conversation in General
Discussion options

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)

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

@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.

You must be logged in to vote
1 reply
Comment options

I understand why it doesn't work, I'm just wondering if there are some workarounds.

Comment options

Closed as obsolete

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /