By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Including a C# class in VB project

P: n/a
Hi,

I'm creating a VB Windows Application project that needs to call some
classes already written in C#.
I can create a class library (dll) and include them as reference in my
project, that works ok.

But I was thinking, could I add directly add the CS files in the VB project
and have access to the class ?

I already did it, but it seems not to work.
If I put "Imports MyCSnamespace" it does not find "MyCSnamespace".
If I delete it, than my reference to the CS classes are invalid in the body
of the VB project.

So, is it possible ?

Regards,

Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Currently not possible.

I have read that in the next version of Visual Studio this will be allowed.

Kevin

"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:Of****************@TK2MSFTNGP12.phx.gbl...
Hi,

I'm creating a VB Windows Application project that needs to call some
classes already written in C#.
I can create a class library (dll) and include them as reference in my
project, that works ok.

But I was thinking, could I add directly add the CS files in the VB
project
and have access to the class ?

I already did it, but it seems not to work.
If I put "Imports MyCSnamespace" it does not find "MyCSnamespace".
If I delete it, than my reference to the CS classes are invalid in the
body
of the VB project.

So, is it possible ?

Regards,

Nov 21 '05 #2

P: n/a

Hi,

Thanks for the comment.
I was digging in the help file and just found something called "multifile
assemblies". It seems this is to help to create a DLL combined by different
languages.
May I misunderstood.
Still reading .....

Regards,
"Kevin Thomas" <Ke***@FakeEmailAddresses.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
Currently not possible.

I have read that in the next version of Visual Studio this will be allowed.
Kevin

"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:Of****************@TK2MSFTNGP12.phx.gbl...
Hi,

I'm creating a VB Windows Application project that needs to call some
classes already written in C#.
I can create a class library (dll) and include them as reference in my
project, that works ok.

But I was thinking, could I add directly add the CS files in the VB
project
and have access to the class ?

I already did it, but it seems not to work.
If I put "Imports MyCSnamespace" it does not find "MyCSnamespace".
If I delete it, than my reference to the CS classes are invalid in the
body
of the VB project.

So, is it possible ?

Regards,


Nov 21 '05 #3

P: n/a
Hey if you read that it can be done, point me to that article. That'd be
pretty cool.

Thanks,

Kevin

"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP12.phx.gbl...

Hi,

Thanks for the comment.
I was digging in the help file and just found something called "multifile
assemblies". It seems this is to help to create a DLL combined by
different
languages.
May I misunderstood.
Still reading .....

Regards,
"Kevin Thomas" <Ke***@FakeEmailAddresses.com> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
Currently not possible.

I have read that in the next version of Visual Studio this will be

allowed.

Kevin

"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:Of****************@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I'm creating a VB Windows Application project that needs to call some
> classes already written in C#.
> I can create a class library (dll) and include them as reference in my
> project, that works ok.
>
> But I was thinking, could I add directly add the CS files in the VB
> project
> and have access to the class ?
>
> I already did it, but it seems not to work.
> If I put "Imports MyCSnamespace" it does not find "MyCSnamespace".
> If I delete it, than my reference to the CS classes are invalid in the
> body
> of the VB project.
>
> So, is it possible ?
>
> Regards,
>
>
>



Nov 21 '05 #4

P: n/a

"Craig Kenisston" <cr************@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP12.phx.gbl...
I was digging in the help file and just found something called "multifile
assemblies". It seems this is to help to create a DLL combined by different languages.
May I misunderstood.
Still reading .....


I believe you create the individual pieces as modules ("netmodules") and
then link them together. I'm not sure if Visual Studio can do this or if you
have to use command-line tools.
Nov 21 '05 #5

P: n/a
In article <ej**************@TK2MSFTNGP10.phx.gbl>, Kevin Thomas wrote:
Hey if you read that it can be done, point me to that article. That'd be
pretty cool.

Thanks,

Kevin


It can be done - just not from the IDE. You can compile your file to a
module (*.netmodule) and then use the assembly linker tool (al.exe) to
create a multifile assembly. You just have to do all your builds from
the command line and it takes more then one step. Of course, you could
create a script to handle it :)

--
Tom Shelton [MVP]
Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.