When you create a new C # project in Visual Studio, the generated AssemblyInfo.cs file contains an attribute indicating the GUID of the assembly. The comment above the attribute states that it is used "if this project is open to COM."
None of my assemblies contain types that should be visible to COM, so I marked my assembly with [assembly: ComVisible(false)] . So does it make sense to specify a GUID?
It seems to me that the answer is no - so why does the AssemblyInfo.cs file by default contain both [assembly: ComVisible(false)] and [assembly: Guid("...")] [assembly: ComVisible(false)] [assembly: Guid("...")] ?
Edit:
To summarize the answers:
Between them, the answers explain that GUID is required if and only if COM interoperability is used. So in my situation, a GUID is not needed.
In addition, sharptooth explains that [assembly: ComVisible(false)] does not mean that COM interaction is not used, since you can override ComVisible for individual types. For this reason, the AssembyInfo.cs file by default contains both [assembly: ComVisible(false)] and a GUID.
user200783 Feb 27 '10 at 8:02 2010-02-27 08:02
source share