.NET:如何弃用 WebMethod?
在 .NET 中,是否有一种标准方法来指示 Web 服务方法已被使用 已弃用?
为了澄清,我所说的“Web 服务方法”是指用 [WebMethod]
属性修饰的方法。
标准做法是仅使用 [已过时]
属性将其标记为已弃用,就像任何其他方法一样?
In .NET, is there a standard way to indicate that a web service method has been
deprecated?
To clarify, by 'web service method', I mean a method that has been decorated with the [WebMethod]
attribute.
Is standard practice to just use the [Obsolete]
attribute to mark it as deprecated, just like any other method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的;标准做法是在 .NET 中使用
[Obsolete]
属性进行弃用。编辑:
请记住,这不会正式传播到暴露给消费者的 WSDL/服务。由于 WS 是跨技术的标准;该协议必须得到遵守。考虑到这一点,不幸的是,您向消费者传播更改的目标将与发行说明相关联,如
Yes; standard practice is to use the
[Obsolete]
attribute for deprecation within .NET.EDIT:
Keep in mind that this will not formally propagate to the WSDL/service as exposed to the consumer. Since WS's are a standard across technologies; the protocol has to be honored. With that in mind your goal of propagating change to the consumer will unfortunately be tied to release notes as noted in this question. While not ideal it does provide a vehicle for deprecation.