This is a migrated thread and some comments may be shown as answers.

Incorrect [ComVisible(false)] in "create project" output

1 Answer 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
J.
Top achievements
Rank 1
J. asked on 18 Jun 2012, 08:11 PM
This may be a new bug; I just installed 2012.2.612.1 and do not think it was in older output.

There is no manifestation of this, as far as I can tell, in the interactive window -- only when "create project" is used.  What I see is the addition of a "using" statement

using System.Runtime.InteropServices;

and an incorrect [ComVisible(false)] attribute before the declaration of a public class (it doesn't seem to matter if the class is static):

namespace MyNamespace
{
[ComVisible(false)]
public class MyClass
{ ....

ILDASM output clearly shows that the actual constructor call passes "true" not "false":

.custom instance void [mscorlib]System.Runtime.InteropServices.ComVisibleAttribute::.ctor(bool)
           = {bool(true)}

#1:  The parameter value should be correct in the output code!
#2:  Given that the default for this attribute is "true" there shouldn't be any representation of it in the output.
#3:  (This is a nit.)  In general, if there is only one reference to a class in a block of code, it would be less disruptive to our examination of the code if the single reference were fully namespace qualified rather than having a "using" statement.  Thus if it were actually correct to have a ComVisible(false) attribute shown, I would rather see

[System.Runtime.InteropServices.ComVisible(false)]

1 Answer, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 22 Jun 2012, 09:14 AM
Hi,

 That is a really weird problem. So let me just make sure I got everything right. In the JD GUI there is no ComVisible attribute and when you create project teh ComVisible attribute appears but it has wrong constructor argument. Is that the case? 

Can we get a copy of the assembly where that happens? If that's not possible can we get the IL output for that class in JD GUI?

Kind regards,
Tsviatko Yovtchev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
J.
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
Share this question
or