Calling C# code from VisualBasic

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SkyRender

    #1

    Calling C# code from VisualBasic

    I'm developing an application for a PocketPC using VisualBasic.NET . I would
    like to incorporate some code which is written in CSharp.NET. Is it possible
    to call C# code from a VB application? What methods could I use to
    accomplish this? Thanks in advance for everyone's help.
  • Sean Hederman

    #2
    Re: Calling C# code from VisualBasic

    "SkyRender" <SkyRender@disc ussions.microso ft.com> wrote in message
    news:9D198E8E-3D97-4ECC-9C19-4E6B2C378DCF@mi crosoft.com...[color=blue]
    > I'm developing an application for a PocketPC using VisualBasic.NET . I
    > would
    > like to incorporate some code which is written in CSharp.NET. Is it
    > possible
    > to call C# code from a VB application?[/color]

    Yes it is.
    [color=blue]
    > What methods could I use to
    > accomplish this?[/color]

    The simplest would be to compile the C# code as a DLL, and then just
    reference it in your VB.NET application.
    [color=blue]
    > Thanks in advance for everyone's help.[/color]


    Comment

    • SkyRender

      #3
      Re: Calling C# code from VisualBasic

      Thanks for the speedy response. I'm actually including a DLL in my C#
      application. Would it cause problems if I compiled a project as a DLL if
      that project included another DLL itself?

      "Sean Hederman" wrote:
      [color=blue]
      > "SkyRender" <SkyRender@disc ussions.microso ft.com> wrote in message
      > news:9D198E8E-3D97-4ECC-9C19-4E6B2C378DCF@mi crosoft.com...[color=green]
      > > I'm developing an application for a PocketPC using VisualBasic.NET . I
      > > would
      > > like to incorporate some code which is written in CSharp.NET. Is it
      > > possible
      > > to call C# code from a VB application?[/color]
      >
      > Yes it is.
      >[color=green]
      > > What methods could I use to
      > > accomplish this?[/color]
      >
      > The simplest would be to compile the C# code as a DLL, and then just
      > reference it in your VB.NET application.
      >[color=green]
      > > Thanks in advance for everyone's help.[/color]
      >
      >
      >[/color]

      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: Calling C# code from VisualBasic

        SkyRender <SkyRender@disc ussions.microso ft.com> wrote:[color=blue]
        > Thanks for the speedy response. I'm actually including a DLL in my C#
        > application. Would it cause problems if I compiled a project as a DLL if
        > that project included another DLL itself?[/color]

        No - because it doesn't include a DLL, it just references it. Depending
        on what the VB.NET application does, that may need to reference the
        extra DLL too.

        --
        Jon Skeet - <skeet@pobox.co m>
        Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

        If replying to the group, please do not mail me too

        Comment

        Working...