Article View: borland.public.csharpbuilder.ide.general
Article #124Re: compiling C# library
From: Andre
Date: Mon, 29 May 2006 07:02
Date: Mon, 29 May 2006 07:02
62 lines
3060 bytes
3060 bytes
"C# dll so that I can use the functionality in a
> Delphi (win32) app."
Your problem lies within the AssemblyInfo.cs file of your C# dll. .NET
Assemblies does not register under COM until you explicitly make .NET
assmeblies visiable to COM.
Open your AssemblyInfo.cs file in C# IDE. Scroll to the very bottom of the
file. You'll see 3 clauses:
[assembly: ComVisible(false)]
//[assembly: Guid("")]
//[assembly: TypeLibVersion(1, 0)]
Set the [assembly: ComVisible(true)]
If you find the other 2 clauses usefull, by al means
I think this would sort you out.
ps: i don't think is nesseary to use the command line params to compile.
"Mark Heschl" <mark@no.spam.com> wrote in message
news:44625449$1@newsgroups.borland.com...
> Hi,
>
> I am trying to compile a C# dll so that I can use the functionality in a
> Delphi (win32) app. The reason for this is because Crystal Reports XI
> does
> not work 100% in Delphi or Delphi.NET.
>
> The steps I take when it doesn't work are:
> 1) Compile through BDS2006 and compile as an assembly (application type)
> 2) From the command line, run "regasm name.dll /tlb" to generate the tlb
> file
> 3) From the Win32 environment, go to Component | Import Component and
> then
> select Import .NET Assembly.
>
> When I get to the last screen, no classes are listed and no class
> declarations are evident in the generated name_tlb.pas file
>
> However, in order to get it to work:
> 1) From the command line, compile using "csc /t:library name.cs"
> 2) From the command line, run "regasm name.dll /tlb" to generate the tlb
> file
> 3) From the Win32 environment, go to Component | Import Component and
> then
> select Import .NET Assembly.
>
> When I get to the last screen, the classes are present and the generated
> name_tlb.pas file has the class declarations and I can access the
> procedures
> that I want.
>
> My question is, how do I get the BDS2006 C# flavor IDE to compile the
> project as if it were compiling witt the "/t:library" switch?
>
> Thanks
>
> Mark
>
>
Technical Details
Message-ID:
<447a9c69@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44625449$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 165859,bc89b6b8138bbd5c X-Google-Attributes: gid165859,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andre" <andretruter@webmail.co.za> Newsgroups: borland.public.csharpbuilder.ide.general References: <44625449$1@newsgroups.borland.com> Subject: Re: compiling C# library Date: Mon, 29 May 2006 09:02:01 +0200 Lines: 64 Organization: Bluewater Systems X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original X-Antivirus: avast! (VPS 0621-4, 05/26/2006), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 196.207.45.253 Message-ID: <447a9c69@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1148886121 196.207.45.253 (29 May 2006 00:02:01 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail