2

I have this error CA1405 "Game1" is marked ComVisible(true) but has the following ComVisible(false) types in its object hierarchy: 'Game' inside what originally was the game1 class. I don't quite understand what this ComVisibility is about, but non the less I like to get rid of the warning.
So why does this happen and how can I fix it?
I don't know what part of my code to add here, so please tell me what you need.

harlekintiger
  • 337
  • 7
  • 22

1 Answers1

2

Right click your Game1 project in the solution explorer, select properties, select the application tab, click the assembly information button, uncheck the "Make assembly COM-Visible" box.

Steve H
  • 5,479
  • 4
  • 20
  • 26
  • 1
    FYI As I understand it, making the entire assembly COM-visible is convenient but not recommended. It is better to explicitly expose those classes and interfaces that require it, with an explicit GUID. I think making the entire assembly COM visible results in new GUIDs generated upon every build, invalidating the previous COM 'contract'. (I stumbled upon this question while seeking guidance for a similar warning message and thought I'd chime in) – Rno Mar 09 '19 at 23:24