I have CA1017 error message with StyleCop saying I need to make it ComVisible false.
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).
Then, I put the code [assembly: ComVisible(false)] before the topmost namespace. However, I still got the same error together with other error messages.
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?)
It seems that VS2010 also doesn’t recognize this name.

What’s wrong with this?
The
ComVisibleAttributeis defined in theSystem.Runtime.InteropServicesnamespace.So you either need to:
Fully-qualify the attribute’s name with its namespace:
Add a
usingdirective to the top of your source file to import the namespace for that file:In the future, you should be able to get Visual Studio to warn you about these things. When you see a squiggly line denoting a compiler error, look for the drop-down button that’s nearby or press Ctrl+. A menu should appear, indicating possible solutions for the problem. In this case, it would have suggested that you take either option 1 or 2 listed above, and with a single click, would have performed all of the necessary actions for you.
(The above amazing animated image was ripped from here.)