Saturday, March 24, 2012

Mixing VB & C# in the same DLL

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" <a@.b.c> wrote in message news:cob7ne$c6v$1@.thorium.cix.co.uk...

> How do you mix VB and C# AND compile into a SINGLE dll?
You don't - you wait for VS.NET 2005...
"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:uKJx55O1EHA.3596@.TK2MSFTNGP12.phx.gbl...
> "gg" <a@.b.c> wrote in message news:cob7ne$c6v$1@.thorium.cix.co.uk...
>
> 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" <SodOffSpammers@.dev.null> wrote in message
news:cocij4$se5$1@.thorium.cix.co.uk...

> 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.
> 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" <SodOffSpammers@.dev.null> wrote in message
news:codt1b$g8n$1@.thorium.cix.co.uk...

> 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...
> 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" <SodOffSpammers@.dev.null> wrote in message
news:cocij4$se5$1@.thorium.cix.co.uk...
> "Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
> news:uKJx55O1EHA.3596@.TK2MSFTNGP12.phx.gbl...
> 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
>
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.
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:%23XoIDvh1EHA.1456@.TK2MSFTNGP10.phx.gbl...
Kevin,

> Only a poor developer blames the development software for their own
> limitations.
Don't even bother - some idiots will never be happy...
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" <a@.b.c> wrote in message news:<cob7ne$c6v$1@.thorium.cix.co.uk>...
> 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

0 comments:

Post a Comment