Mixing VB & C# in the same DLL

Discussion in 'ASP .Net' started by gg, Nov 28, 2004.

  1. gg

    gg Guest

    Hi,

    I'm sure this must be one of the most popular questions...

    I've developed the application in VB and have some C# code which I want to
    incorporate. Visual Studio seems to allow you either a VB or C# project,
    neither of which can contain files from the other language. The official
    method of combining languages is to create two projects under the same
    solution, one for the VB code, one for the C# code. This seems pants.

    How do you mix VB and C# AND compile into a SINGLE dll?


    TIA,
    Glenn
     
    gg, Nov 28, 2004
    #1
    1. Advertising

  2. gg

    Mark Rae Guest

    "gg" <> wrote in message news:cob7ne$c6v$...

    > How do you mix VB and C# AND compile into a SINGLE dll?


    You don't - you wait for VS.NET 2005...
     
    Mark Rae, Nov 28, 2004
    #2
    1. Advertising

  3. gg

    Glenn Guest

    "Mark Rae" <> wrote in message
    news:...
    > "gg" <> wrote in message news:cob7ne$c6v$...
    >
    >> How do you mix VB and C# AND compile into a SINGLE dll?

    >
    > You don't - you wait for VS.NET 2005...


    And then wait for VS 2007 - 'cos they forgot to add something else, then
    wait for VS 2009 'cos they forgot to add something else.....

    It's never ending. Why don't we all just send Microsoft our first born and
    get on with it.

    Just as a point, I'm still developing stuff with VS2002 -- I couldn't see
    the point in paying those scumbags any money for 'new features' that I don't
    need. In any case, they should have released VS2003 as a service pack.


    Glenn
     
    Glenn, Nov 28, 2004
    #3
  4. gg

    Mark Rae Guest

    "Glenn" <> wrote in message
    news:cocij4$se5$...

    >>> How do you mix VB and C# AND compile into a SINGLE dll?

    >>
    >> You don't - you wait for VS.NET 2005...

    >
    > And then wait for VS 2007 - 'cos they forgot to add something else, then
    > wait for VS 2009 'cos they forgot to add something else.....


    Yeah - they got the internal combustion engine right at the first attempt...

    > It's never ending. Why don't we all just send Microsoft our first born
    > and get on with it.


    You are, truly, a cretin.
     
    Mark Rae, Nov 28, 2004
    #4
  5. gg

    Glenn Guest

    > You are, truly, a cretin.
    I see. So by actually questioning the basis of what MS has to offer makes
    me an idiot?

    I guess you would have voted for Bush's second term given the chance?

    Now, to answer my original question, we can do the linking into a single
    DLL. It looks as if an open source utility (that's a non MS one, so it
    *must* be crap to certain people): NAnt is a free .NET build tool. In
    theory it is kind of like make without make's wrinkles.
    http://nant.sourceforge.net/

    Pity MS couldn't develop VS to do this in the first place as it would make
    the cross-over from VB to C# or back much easier for all of us.


    Glenn
     
    Glenn, Nov 29, 2004
    #5
  6. gg

    Mark Rae Guest

    "Glenn" <> wrote in message
    news:codt1b$g8n$...

    > I guess you would have voted for Bush's second term given the chance?


    I rejoice every day in the fact that I'll never be eligible to vote in an
    American election...
     
    Mark Rae, Nov 29, 2004
    #6
  7. > And then wait for VS 2007 - 'cos they forgot to add something else, then
    > wait for VS 2009 'cos they forgot to add something else.....
    >
    > It's never ending. Why don't we all just send Microsoft our first born

    and
    > get on with it.


    Only a poor developer blames the development software for their own
    limitations. I can remember writing C programs using a shareware
    command-line compiler that used Kernigan-Ritchie C code. Don't ever remember
    complaining about the compiler software, though. Didn't seem helpful to the
    task.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "Glenn" <> wrote in message
    news:cocij4$se5$...
    >
    > "Mark Rae" <> wrote in message
    > news:...
    > > "gg" <> wrote in message news:cob7ne$c6v$...
    > >
    > >> How do you mix VB and C# AND compile into a SINGLE dll?

    > >
    > > You don't - you wait for VS.NET 2005...

    >
    > And then wait for VS 2007 - 'cos they forgot to add something else, then
    > wait for VS 2009 'cos they forgot to add something else.....
    >
    > It's never ending. Why don't we all just send Microsoft our first born

    and
    > get on with it.
    >
    > Just as a point, I'm still developing stuff with VS2002 -- I couldn't see
    > the point in paying those scumbags any money for 'new features' that I

    don't
    > need. In any case, they should have released VS2003 as a service pack.
    >
    >
    > Glenn
    >
    >
     
    Kevin Spencer, Nov 29, 2004
    #7
  8. I know I shouldn't feed the trolls. But, you didn't by any chance notice
    that at least one microsoft employee contributed code to NAnt did you? Also,
    I've seen multiple MS employees discuss NAnt and NUnit as useful tools.
     
    =?Utf-8?B?U2NvdHQgU2ltb25z?=, Nov 29, 2004
    #8
  9. gg

    Mark Rae Guest

    "Kevin Spencer" <> wrote in message
    news:%...

    Kevin,

    > Only a poor developer blames the development software for their own
    > limitations.


    Don't even bother - some idiots will never be happy....
     
    Mark Rae, Nov 29, 2004
    #9
  10. gg

    Amar Guest

    I don't know if it is possible to have both languages at the same dll
    and use classes, but it is possible if you interested to have at the
    same project .aspx pages with both languages.

    "gg" <> wrote in message news:<cob7ne$c6v$>...
    > Hi,
    >
    > I'm sure this must be one of the most popular questions...
    >
    > I've developed the application in VB and have some C# code which I want to
    > incorporate. Visual Studio seems to allow you either a VB or C# project,
    > neither of which can contain files from the other language. The official
    > method of combining languages is to create two projects under the same
    > solution, one for the VB code, one for the C# code. This seems pants.
    >
    > How do you mix VB and C# AND compile into a SINGLE dll?
    >
    >
    > TIA,
    > Glenn
     
    Amar, Nov 30, 2004
    #10
  11. gg

    Glenn Guest

    Hmm, not that this is worth much, but it seems there's been some
    misunderstandings. It must be my fault for not writing more clearly.

    As a VB developer, I've got some code which is in C#. Of course I could
    port this code to VB, but it's rather defeating the object.

    A couple of years ago I saw a demo at TechEd showing mixed code and thought
    this might be trivially easy. It turns out that you have to mess around
    creating projects for each language and that it compiles down to multiple
    dlls. Sure, this works, but not as expected.

    Hence, I feel it's reasonable to criticise VS for not allowing mixed code
    as that is what was demonstrated.

    So that leaves me with two choices; accept the status quo and compile to
    two DLLs, or wait for VS 2005.

    The final criticism of VS 2003 is that some JavaScript debugging features
    have been removed. It is possible to get more debugging info from VS 2002,
    particularly about the state of JS objects. As I don't need the additional
    XML and other features of VS 2003, I don't need to use it.

    I guess if that makes me an idiot, well, I guess that makes an idiot of
    everyone.


    Have a nice day,
    Glenn
     
    Glenn, Nov 30, 2004
    #11
  12. gg

    Glenn Guest

    Oh, and one other thing...

    Many of the ISP hosts that my customers use still *only* support v1.0 of the
    framework. If I develop using v1.1 (VS2003), I might end up using a
    feature that's not backward compatible.

    Being prudent isn't being a dinosaur, it's being pragmatic.


    Glenn
     
    Glenn, Nov 30, 2004
    #12
    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. dhruba.bandopadhyay

    QUERY: Mixing ASP.NET 1.1 & 2.0 pages in same website

    dhruba.bandopadhyay, Apr 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    373
    dhruba.bandopadhyay
    Apr 28, 2006
  2. Mufasa
    Replies:
    5
    Views:
    294
    Mark Rae
    Apr 18, 2007
  3. John Scheldroup

    Mixing C and C++ Code in the Same Program

    John Scheldroup, Apr 2, 2008, in forum: C++
    Replies:
    0
    Views:
    322
    John Scheldroup
    Apr 2, 2008
  4. Jaime Buelta
    Replies:
    0
    Views:
    262
    Jaime Buelta
    Oct 22, 2009
  5. Ravi
    Replies:
    4
    Views:
    388
    Alf P. Steinbach /Usenet
    Jul 19, 2010
Loading...

Share This Page