----- Original Message ----- From: "Sascha Andres" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 14, 2003 6:39 PM Subject: Re: [Nant-users] asminfo und ComVisible Attribut
> Hallo Gert, > * Am 14.11.2003 (17:41) schriebst Du: > > I think I'm missing the problem here : why is '[assembly: > > ComVisibleAttribute(false)]' wrong ? > > The compiler doesn't reject ComVisibleAttribute set to > false, but when looking at the compiled result, ComVisible > is set to true (default), hence the class is visible for > COM. Are you sure about this, seems very unlikely ? > > The syntax (as described in the SDK documentation) is > definitly [assembly: ComVisible(false)] for assembly wide > setting and [ComVisible(false)] on a per function base. > > > The <asminfo> task is indeed incapable of locating the attribute type if you > > don't specifiy its actual type name (meaning with the Attribute suffix), as > > ComVisible itself is not the actual type name. > > > > Please help me understand your problem ... > > Here is a slight problem: There are attributes where the > type name is different to the syntactic use in C#. Then you > can't use asminfo to generate AssemblyInfo.cs. I need a set > of these attributes (ComVisible is only one), for making my > application compliant with Microsoft .NET Framework Design > Guidelines. > There are no attributes where the type name is different from the syntax to be used in c#. C# does not require the Attribute suffix for attributes, but it will translate these to their full type names .... Meaning ComVisible will be translated to ComVisibleAttribute, so the result is the same ... I've included a build file which will definitely generate the expected results ... Gert
<project name="test" default="test2"> <target name="test2"> <!-- <asminfo output="AssemblyInfo.cs" language="CSharp"> <imports> <import name="System" /> <import name="System.Reflection" /> <import name="System.EnterpriseServices" /> <import name="System.Runtime.InteropServices" /> </imports> <attributes> <attribute type="ComVisibleAttribute" value="false" /> <attribute type="CLSCompliantAttribute" value="true" /> <attribute type="AssemblyVersionAttribute" value="1.0.0.0" /> <attribute type="AssemblyTitleAttribute" value="My fun assembly" /> <attribute type="AssemblyDescriptionAttribute" value="More fun than a barrel of monkeys" /> <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2002, Monkeyboy, Inc." /> <attribute type="ApplicationNameAttribute" value="FunAssembly" /> </attributes> <references> <includes name="System.EnterpriseServices.dll" /> </references> </asminfo> --> <csc target="library" output="test.dll"> <sources> <includes name="AssemblyInfo.cs" /> </sources> </csc> </target> </project>