-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NS2002 falsely triggered by optional ctor args #176
Comments
Actually, I'm unsure of this. Forgetting about the analyser for now (I just disabled it), I nonetheless get this exception; Exception thrown: 'Castle.DynamicProxy.InvalidProxyConstructorArgumentsException' in Castle.Core.dll Weird, those args are optional, I'd have thought this would work? |
Hi @lonix1. As you've seen
I assume this is limitation of Catle.Core rather than issue with |
Your idea of a more descriptive warning is good. It will let the user know that it is "normal" and there is nothing he can do about it. |
IIRC optional arguments are injected at compile-time? In that case Castle.Core will have no way of knowing what to pass to the constructor. (see also this thread). Does Roslyn provide access to optional param information? If so maybe that should be a new error explaining optional parameters must be passed explicitly (possibly quick fix to pass the defaults?). |
NS2002 / Constructor parameters count mismatch
Here's a type:
This triggers the analyzer:
Those ctor args are optional.
The text was updated successfully, but these errors were encountered: