red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

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

Closed ddemeyer closed 8 years ago

ddemeyer commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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