Can I use C# code in a VB project?

Discussion in 'ASP .Net' started by Diego F., May 19, 2005.

  1. Diego F.

    Diego F. Guest

    Is it possible to use directly C# code into a VB project?

    If not, is there any tool to convert from C# to VB.NET?

    --
    Regards,

    Diego F.
     
    Diego F., May 19, 2005
    #1
    1. Advertising

  2. Diego F.

    Mark Rae Guest

    "Diego F." <> wrote in message
    news:...

    > Is it possible to use directly C# code into a VB project?


    Not currently...

    > If not, is there any tool to convert from C# to VB.NET?


    Several - Google it.
     
    Mark Rae, May 19, 2005
    #2
    1. Advertising

  3. re:
    > Is it possible to use directly C# code into a VB project?


    No. Only one language per project is permitted.

    You can, however, VB project(s) and C# project(s) in a single solution.

    You can also do a command-line compilation of one of your projects
    and add a reference to that assembly ( those assemblies ) in your other project.

    re:
    > If not, is there any tool to convert from C# to VB.NET?


    This free online resource works pretty good :
    http://www.developerfusion.com/utilities/convertvbtocsharp.aspx
    Notice that you can go both ways.

    If you prefer a desktop program,
    the free SharpDevelop editor has a nifty conversion feature :

    http://www.icsharpcode.net/OpenSource/SD/

    It will *only* translate *.vb and *.cs files, though.



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Diego F." <> wrote in message
    news:...
    > Is it possible to use directly C# code into a VB project?
    >
    > If not, is there any tool to convert from C# to VB.NET?
    >
    > --
    > Regards,
    >
    > Diego F.
    >
     
    Juan T. Llibre, May 19, 2005
    #3
  4. Hi Diego,

    > Is it possible to use directly C# code into a VB project?


    With Visual Studio.Net 2005 only, you can do this, not with previous
    versions.

    > If not, is there any tool to convert from C# to VB.NET?


    Not any good ones.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Sometimes you eat the elephant.
    Sometimes the elephant eats you.

    "Diego F." <> wrote in message
    news:...
    > Is it possible to use directly C# code into a VB project?
    >
    > If not, is there any tool to convert from C# to VB.NET?
    >
    > --
    > Regards,
    >
    > Diego F.
    >
     
    Kevin Spencer, May 19, 2005
    #4
  5. We sell Instant VB, a C# to VB.NET converter. Download the Demo Edition at
    www.instantvb.com.

    It's the only high-quality C# to VB.NET converter that:
    1. Converts entire projects.
    2. Converts ASP.NET pages.
    3. Has a fully-supported demo.

    David Anton
    www.tangiblesoftwaresolutions.com
    Home of the Instant C# VB.NET to C# converter
    and the Instant VB C# to VB.NET converter

    "Diego F." wrote:

    > Is it possible to use directly C# code into a VB project?
    >
    > If not, is there any tool to convert from C# to VB.NET?
    >
    > --
    > Regards,
    >
    > Diego F.
    >
    >
    >
     
    =?Utf-8?B?RGF2aWQgQW50b24=?=, May 19, 2005
    #5
  6. "Not any good ones."
    Before making such a blanket statement, try ours - Instant VB at
    www.instantvb.com.

    David Anton
    www.tangiblesoftwaresolutions.com
    Home of the Instant C# VB.NET to C# converter
    and the Instant VB C# to VB.NET converter

    "Kevin Spencer" wrote:

    > Hi Diego,
    >
    > > Is it possible to use directly C# code into a VB project?

    >
    > With Visual Studio.Net 2005 only, you can do this, not with previous
    > versions.
    >
    > > If not, is there any tool to convert from C# to VB.NET?

    >
    > Not any good ones.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > ..Net Developer
    > Sometimes you eat the elephant.
    > Sometimes the elephant eats you.
    >
    > "Diego F." <> wrote in message
    > news:...
    > > Is it possible to use directly C# code into a VB project?
    > >
    > > If not, is there any tool to convert from C# to VB.NET?
    > >
    > > --
    > > Regards,
    > >
    > > Diego F.
    > >

    >
    >
    >
     
    =?Utf-8?B?RGF2aWQgQW50b24=?=, May 19, 2005
    #6
  7. Diego F.

    Diego F. Guest

    I'm using VS 2005 beta1. I add files, but it doesn't recognize the namespace
    in VB classes.

    In fact it is a complete project and I could generate the dll, but then I
    have problems running in a network project. It runs locally, but when moving
    to the server it throws security exceptions.

    --

    Regards,

    Diego F.

    "Kevin Spencer" <> escribió en el mensaje
    news:...
    > Hi Diego,
    >
    >> Is it possible to use directly C# code into a VB project?

    >
    > With Visual Studio.Net 2005 only, you can do this, not with previous
    > versions.
    >
    >> If not, is there any tool to convert from C# to VB.NET?

    >
    > Not any good ones.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > Sometimes you eat the elephant.
    > Sometimes the elephant eats you.
    >
    > "Diego F." <> wrote in message
    > news:...
    >> Is it possible to use directly C# code into a VB project?
    >>
    >> If not, is there any tool to convert from C# to VB.NET?
    >>
    >> --
    >> Regards,
    >>
    >> Diego F.
    >>

    >
    >
     
    Diego F., May 19, 2005
    #7
  8. You're right, David. I'm guilty of making an assumption. I should have said
    "not any good ones that I know of." And now I'm not so sure. Your app may
    indeed be capable of doing a very good direct translation. I wouldn't use
    such a thing, as there are optimizations that can be performed when porting,
    but these are not absolutely necessary, and it may well prove quite useful
    to many developers.

    Thanks for keeping me straight!

    --

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Sometimes you eat the elephant.
    Sometimes the elephant eats you.

    "David Anton" <> wrote in message
    news:...
    > "Not any good ones."
    > Before making such a blanket statement, try ours - Instant VB at
    > www.instantvb.com.
    >
    > David Anton
    > www.tangiblesoftwaresolutions.com
    > Home of the Instant C# VB.NET to C# converter
    > and the Instant VB C# to VB.NET converter
    >
    > "Kevin Spencer" wrote:
    >
    >> Hi Diego,
    >>
    >> > Is it possible to use directly C# code into a VB project?

    >>
    >> With Visual Studio.Net 2005 only, you can do this, not with previous
    >> versions.
    >>
    >> > If not, is there any tool to convert from C# to VB.NET?

    >>
    >> Not any good ones.
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> ..Net Developer
    >> Sometimes you eat the elephant.
    >> Sometimes the elephant eats you.
    >>
    >> "Diego F." <> wrote in message
    >> news:...
    >> > Is it possible to use directly C# code into a VB project?
    >> >
    >> > If not, is there any tool to convert from C# to VB.NET?
    >> >
    >> > --
    >> > Regards,
    >> >
    >> > Diego F.
    >> >

    >>
    >>
    >>
     
    Kevin Spencer, May 19, 2005
    #8
  9. Hi Diego,

    I did cover the security exception you described in my reply to your other
    thread about the exception. that is a simple Assembly Trust issue.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Sometimes you eat the elephant.
    Sometimes the elephant eats you.

    "Diego F." <> wrote in message
    news:...
    > I'm using VS 2005 beta1. I add files, but it doesn't recognize the
    > namespace in VB classes.
    >
    > In fact it is a complete project and I could generate the dll, but then I
    > have problems running in a network project. It runs locally, but when
    > moving to the server it throws security exceptions.
    >
    > --
    >
    > Regards,
    >
    > Diego F.
    >
    > "Kevin Spencer" <> escribió en el mensaje
    > news:...
    >> Hi Diego,
    >>
    >>> Is it possible to use directly C# code into a VB project?

    >>
    >> With Visual Studio.Net 2005 only, you can do this, not with previous
    >> versions.
    >>
    >>> If not, is there any tool to convert from C# to VB.NET?

    >>
    >> Not any good ones.
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> .Net Developer
    >> Sometimes you eat the elephant.
    >> Sometimes the elephant eats you.
    >>
    >> "Diego F." <> wrote in message
    >> news:...
    >>> Is it possible to use directly C# code into a VB project?
    >>>
    >>> If not, is there any tool to convert from C# to VB.NET?
    >>>
    >>> --
    >>> Regards,
    >>>
    >>> Diego F.
    >>>

    >>
    >>

    >
    >
     
    Kevin Spencer, May 19, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon
    Replies:
    3
    Views:
    426
    Ron McNulty
    Jul 19, 2003
  2. TaeHo Yoo
    Replies:
    2
    Views:
    371
    TaeHo Yoo
    Jul 19, 2003
  3. moondaddy
    Replies:
    4
    Views:
    756
    Steven Cheng[MSFT]
    Jul 27, 2004
  4. danthman
    Replies:
    4
    Views:
    369
    =?Utf-8?B?RGF2aWQgSmVzc2Vl?=
    Dec 17, 2005
  5. unknown;
    Replies:
    2
    Views:
    304
    unknown;
    Dec 18, 2006
Loading...

Share This Page