How to elegantly prevent a webservice proxy from being exposed to COM?

做~自己de王妃 提交于 2019-11-28 14:15:56
Robert Giesecke

You could

  • mark the assembly itself to not to be ComVisible and then explicitly mark all interfaces/classes/enums you want to expose to COM as ComVisible.
  • use a 2nd file and partial class to mark your proxy types to be ComVisible(false)

    [System.Runtime.InteropServices.ComVisible(false)]
    partial class YourProxyType {} 
    
    [System.Runtime.InteropServices.ComVisible(false)]
    partial class AnotherProxyType {}
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!