Unity wraps exception to the ResolutionFailedException. How to avoid?

后端 未结 4 1404
我在风中等你
我在风中等你 2021-01-22 12:51

I want to know, is there the possibility to ask Unity \"do not wrap any user exceptions at resolve time\"?

Really, why Unity do wrappings to ResolutionFailedException?

4条回答
  •  感动是毒
    2021-01-22 13:15

    Because your constructors should contain no logic.

    I know that's not a completely satisfying answer, but I'm not aware that you can switch off this behavior in Unity - I also do agree that it's a strange design decision...

    However, if you keep your constructors simple, you will not have that problem.

提交回复
热议问题