.NET 中的 System.Runtime.InteropServices.UCOM* 类和 System.Runtime.InteropServices.ComTypes.* 之间有区别吗?
我正在尝试从旧系统中删除一堆警告,其中之一是:
“System.Runtime.InteropServices.UCOMIEnumMoniker”已过时:“请改用 System.Runtime.InteropServices.ComTypes.IEnumMoniker”。 http://go.microsoft.com/fwlink/?linkid=14202'< /p>
那里System.Runtime.InteropServices 中的其他 UCOM 类也有类似的警告。该警告实际上相当清楚地说明了该做什么,我真的很想遵循它给出的建议。如果他们只是重命名这些类(删除“UCOM”部分)并将它们移动到 ComTypes
命名空间中,我会非常乐意这样做。但我不知道他们是否就是这样做的,所以我问你,因为如果发生任何事情真正改变了这些类,我不太愿意只使用新的类,因为我没有真正的方法广泛测试任何更改(这是我现在不想讨论的另一个问题)。
那么,有人知道这些新旧课程之间是否有真正的区别吗?
谢谢!
I'm trying to remove a bunch of warnings from an old system and one of them is this:
'System.Runtime.InteropServices.UCOMIEnumMoniker' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.IEnumMoniker instead. http://go.microsoft.com/fwlink/?linkid=14202'
There are similar warnings for other UCOM classes in System.Runtime.InteropServices
. The warning is actually fairly clear on what to do, and I really want to follow the advice that it is giving. I would be perfectly comfortable doing just that if they just renamed the classes (removed the 'UCOM' part) and moved them into the ComTypes
namespace. But I don't know if that's what they did, so I'm asking you, because if anything happened to really change those classes, I'm not very comfortable to just use the new ones instead, since I have no real way to extensively test any changes (which is a whole other problem that I don't really want to get into now).
So, does anyone know if there is a real difference between these old and new classes?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相当确定它们被重命名是因为它们严重违反了 .NET 框架命名标准。接口类型名称需要以字母“I”开头。这些声明之间存在一些非常微妙的差异,不会给您带来麻烦。
I'm fairly sure they got renamed because of their grating violation of the .NET framework naming standards. An interface type name needs to start with the letter "I". There are a few very subtle differences between the declarations, nothing that's going to get you into trouble.