microsoft/dotnet-apiport

Improve guidance for unsupported properties with default values

mconnew opened this issue · 1 comments

This suggestion is based on real experience helping an internal customer identify missing API's in the WCF client implementation. We have some properties on our classes which are either server only api's or aren't currently supported. An example of this is NetTcpBinding.TransactionFlow. On .NET Framework, this property is defined like this:

        [DefaultValue(NetTcpDefaults.TransactionsEnabled)]
        public bool TransactionFlow
        {
            get { return context.Transactions; }
            set { context.Transactions = value; }
        }

The customer wasn't using transactions and were actually just setting this property to false, which is the value of NetTcpDefaults.TransactionsEnabled. There are many WCF api's which have a DefaultValue attribute applied. If someone's code is simply setting an unsupported property to the default value, it's effectively a no-op. I believe there would be some benefit to having the guidance on the usage of api's such as this state that they are setting the value to the default value and the code can most likely be removed.

Closing as API Port was deprecated in favor of binary analysis in .NET Upgrade Assistant.