Mixing VB & C# in the same DLL

G

gg

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
 
G

Glenn

Mark Rae said:
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
 
M

Mark Rae

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.
 
G

Glenn

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
 
M

Mark Rae

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...
 
K

Kevin Spencer

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.
 
G

Guest

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.
 
A

Amar

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.
 
G

Glenn

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
 
G

Glenn

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top