Why is GUID attribute needed in the first place?

后端 未结 5 906
梦如初夏
梦如初夏 2020-12-09 10:58

What is the necessity for the GUID attribute? why don\'t just let the compiler handle this automatically?!

5条回答
  •  庸人自扰
    2020-12-09 11:05

    You can do it (just omit the attribute) but then the compiler will generate a new GUID on each recompile even if the interface has not changed. That's unfortunate because the users of that interface don't know about the change and will retrieve the interface by it's old GUID and will therefore fail to retrieve it.

提交回复
热议问题