Skip to content
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

Provide more console details on how to correct 'System.ArgumentException: Property Get method was not found.' #22

Closed
ddemeyer opened this issue Jul 15, 2016 · 2 comments

Comments

@ddemeyer
Copy link

ddemeyer commented Jul 15, 2016

While debugging 'System.ArgumentException: Property Get method was not found.' at XmlDoc2CmdletDoc.Core.Domain.Parameter.get_DefaultValue() I eventually found it means you are messing a get'er on a Property like
public SomeObject SomeObject
{
set { _id = value.SomeRef; }
}

It would be nice to know on which cmdlet, property or attribute it fails to easily correct the situation. At least the above will give guidance to others.

@ChrisLambrou
Copy link
Contributor

If a parameter doesn't have a getter, we cannot read it to determine its default value. In that situation, we can simply not include a default value in the help docs.

Should we record a warning for this scenario? Bear in mind that if the -strict flag is enabled, warnings are treated as errors and the tool will fail? I'm leaning towards including a warning. Whenever we encounter a Parameter with no getter, I think it's far more likely to be evidence of a coding error than a deliberate choice, and by emitting a warning, it will highlight this deficiency.

@ChrisLambrou
Copy link
Contributor

This has been fixed in 0.2.4. I opted to record a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants