Replies: 3 comments
-
Hi! Did I understand correctly that you created your own .NET source code generator that generates partial classes implementing additional interfaces? Then that's a curiosity :) Generators are executed sequentially one after another. Perhaps Pure.DI in this chain is earlier than your generator and the semantic model it uses to check bindings is built before the new syntax is added by your generator. I have debugged the moment when the generators are enumerated when control is passed to them and I don't remember there being any sorting that could affect the sequence of code generation. If I can't find anything, I can suggest to add a "hint" (like this) for your case, which will disable the checks of bindings that relate to the implementation of interfaces. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately I didn't find a way to control the code generation sequence so I added a "hint" named Hint.SeverityOfNotImplementedContract in version 2.0.48. You can use it as follows: DI.Setup(...)
.Hint(Hint.SeverityOfNotImplementedContract, "Hidden") Please try this method and let me know if it worked for you. |
Beta Was this translation helpful? Give feedback.
-
By the way, the current discussion is also related to this one, there was a similar problem. But the situation there was more complicated, we needed information on a cosntructor that did not exist yet. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm working on a library to communicate with a third party software using COM through some proxy classes I created like below code:
Since this third party software has a considerable amount of interfaces to interact with,,I decided to implement a source generator to create the rest of proxy classes commom implementation. On the generator output some interfaces are added to compose the proxy class a well for example:
The problem starts when i try to create a composition for example:
Since my generator correctly added the necessary code I expect that SampleClassProxy implements IProxyBase, but some how the following error appears after trying to build:
Somehow if I pick the interface implementation previously at generated file and then move it to the original class file the project build without any issues. Is something that I'm missing to catch the expected result? This is my first try to use this library so I'm struggling a little with it.
Beta Was this translation helpful? Give feedback.
All reactions