System.Runtime.InteropServices之间有什么区别吗?类和System.Runtime.InteropServices.ComTypes UCOM *。*在。net ?

时间:2021-10-11 19:50:13

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'

“System.Runtime.InteropServices。UCOMIEnumMoniker”已过时:“Use System.Runtime.InteropServices.ComTypes”。IEnumMoniker代替。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).

在System.Runtime.InteropServices中,对于其他UCOM类也有类似的警告。这个警告实际上是相当明确的,关于该怎么做,我真的想遵循它给出的建议。如果它们只是重命名了类(删除了“UCOM”部分),并将它们移动到ComTypes名称空间中,我将非常乐意这样做。但是我不知道他们做了什么,所以我问你,因为如果发生了什么事真正改变这些类,我不太舒服就用新的代替,因为我没有真正的方式广泛测试任何变化(这是另一个问题,我现在真的不想进入)。

So, does anyone know if there is a real difference between these old and new classes?

那么,有没有人知道这些新老类之间是否存在真正的区别呢?

Thanks!

谢谢!

1 个解决方案

#1


1  

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.

我敢肯定,它们之所以被重新命名,是因为它们违反了。net框架的命名标准。接口类型名称需要以字母“I”开头。声明之间有一些非常微妙的区别,没有什么会让你陷入麻烦。

#1


1  

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.

我敢肯定,它们之所以被重新命名,是因为它们违反了。net框架的命名标准。接口类型名称需要以字母“I”开头。声明之间有一些非常微妙的区别,没有什么会让你陷入麻烦。