Docs: Example has invalid value warning

Created on 3 Jul 2018  Â·  3Comments  Â·  Source: dotnet/docs

In VS 15.7 the example code will lead to an invalid value warning/error for Enum constraint failure
for the deliveryMethod attribute, which has network as its value in the example, but should be Network.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - .NET Framework Guide Technology - NCL P2 doc-bug

Most helpful comment

Thanks, @davidsh. I assume that the casing applies as well to SpecifiedPickupDirectory and PickupDirectoryFromIis, both of which are therefore also incorrect. I'll submit a PR to correct these shortly.

All 3 comments

Thanks for bringing this to our attention, @ite-klass. @davidsh, can you confirm that the value of the deliveryMethod attribute should be Network rather than network?

The public enum type SmtpDeliveryMethod has these values:

https://github.com/Microsoft/referencesource/blob/3b1eaf5203992df69de44c783a3eda37d3d4cd10/System/net/System/Net/mail/SmtpClient.cs#L22-L28

c# public enum SmtpDeliveryMethod { Network, SpecifiedPickupDirectory, PickupDirectoryFromIis }

So, the casing should match the public enum value "Network". The code example on the documentation page should be fixed.

Thanks, @davidsh. I assume that the casing applies as well to SpecifiedPickupDirectory and PickupDirectoryFromIis, both of which are therefore also incorrect. I'll submit a PR to correct these shortly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Manoj-Prabhakaran picture Manoj-Prabhakaran  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

stanuku picture stanuku  Â·  3Comments

mekomlusa picture mekomlusa  Â·  3Comments

stjepan picture stjepan  Â·  3Comments