我收到 StyleCop 的 CA1017 错误消息,说我需要将其设为 ComVisible 为假。
Error 18 CA1017 : Microsoft.Design :
Because 'NationalInstruments.Labview.FPGA.ModelsimCommunicator.dll' exposes externally
visible types, mark it with ComVisible(false) at the assembly level and then mark all
types within the assembly that should be exposed to COM clients with ComVisible(true).
然后,我将代码放在[assembly: ComVisible(false)]
最顶层的命名空间之前。但是,我仍然收到相同的错误以及其他错误消息。
Error 19 The type or namespace name 'ComVisible' could not be found (are you
missing a using directive or an assembly reference?)
Error 20 The type or namespace name 'ComVisibleAttribute' could not be found (are
you missing a using directive or an assembly reference?)
似乎VS2010也不识别这个名字。
这有什么问题?