Using VB.NET and C# projects in one solution in VS2002/2003

J

Just D.

All,

Who played with that? Is it possible to use VB.NET and C# projects in one
solution in VS2002/2003? Or this feature appeared only in VS2005? If yes,
then what kind of traps are on this way?

I see that I can add a VB.NET class library project to my VS2003 solution, I
can add a reference to my existing project in C#, I even can add USING to C#
source code, although it already doesn't have any intellisense comparing to
all other class libraries written in C#. And I can't make any call of any
class from this VB.NET class library. Clinics?

Just D.
 
C

chanmm

I have done a lot of demo on that and it works since VS 2002. Even you
included it in the reference but you still need to use the using keyword to
get the class in.

chanmm
 
S

simida

I used VB.NET class library and c# projects in one solution in VS2003.
It worked fine.

you should make sure that the keyword in C# shouldn't be used in the
VB.NET source code, such as, variable name or others.

Sincerely,
simida

Just D. 写é“:
 
C

Carl Daniel [VC++ MVP]

Just said:
All,

Who played with that? Is it possible to use VB.NET and C# projects in
one solution in VS2002/2003? Or this feature appeared only in VS2005?
If yes, then what kind of traps are on this way?

I see that I can add a VB.NET class library project to my VS2003
solution, I can add a reference to my existing project in C#, I even
can add USING to C# source code, although it already doesn't have any
intellisense comparing to all other class libraries written in C#.
And I can't make any call of any class from this VB.NET class
library. Clinics?

It sounds like your C# classes aren't public. The default access in C# is
'internal'. Make sure that the 'public' keyword appears in your C# class
definitions and you should be fine.

e.g.

public class MyClass
{
}

-cd
 
J

Just D.

Carl,

I'm talking about C#, the main solution has about 30 projects in C# and
everything works just great. I added one project in VB.NET and I'm not able
to get it in C# project after I added the reference as usual. The VB project
has a single class only.

"Carl Daniel [VC++ MVP]"
 
J

Jon Skeet [C# MVP]

Just D. said:
I'm talking about C#, the main solution has about 30 projects in C# and
everything works just great. I added one project in VB.NET and I'm not able
to get it in C# project after I added the reference as usual. The VB project
has a single class only.

Make absolutely sure you're "using" the right namespace. I seem to
remember the IDE likes to add the project name to the namespace - look
at the DLL in Reflector to be absolutely sure of what's in there.
 

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

Top