vb6 to vb.net problem

nishna

Member
Joined
Jan 17, 2008
Messages
19
Programming Experience
1-3
hi to all.
iv have converted a vb6 project to vb.net which is working fine when running as stand-alone.
but if i try to add it to an existing project through 'imports ....', i do not get the project reference.
any advice, most welcome.
thnks
regards, nishna
 
Importing and referencing are two completely different things. You don't import a project. You add a reference to a project. What's more, you can only reference projects that compile to a DLL, not an EXE.
 
What's more, you can only reference projects that compile to a DLL, not an EXE.
That's not true, you can reference any .Net compiled assembly, including Windows Applications and Console applications. But the use of doing this is limited, you would put common functionality in class libraries to be used by all applications that need it.
 
That's not true, you can reference any .Net compiled assembly, including Windows Applications and Console applications. But the use of doing this is limited, you would put common functionality in class libraries to be used by all applications that need it.
Well, that is interesting. VS.NET 2003 wouldn't let you reference an EXE but it appears that that has changed from VS 2005. Given that you could simply change the file extension to ".dll" and add the reference I guess they figured it wasn't worth worrying about. I've learned something new.
 
i'm using multiple projects in 1 solution explorer.
1 existing project created on vb6.0(converted to .net) and another on vb.net itself.
both projects are being referenced.
but when i try to call them in the code,

imports x ,

where x is the project

i am able to import only the project created in vb.net and not the 1 converted to .net

any idea what could cause this??
thnks
 
Well, that is interesting. VS.NET 2003 wouldn't let you reference an EXE
I never tried to do that with VB 2003, but there was a question about this last year or the other where I tried it in VB 2005 - otherwise I would probably never even thought about doing that :) It makes sense that it's possible though, as it is the same mechanism used for loading assemblies for reflection.
 
i'm using multiple projects in 1 solution explorer.
1 existing project created on vb6.0(converted to .net) and another on vb.net itself.
both projects are being referenced.
but when i try to call them in the code,

imports x ,

where x is the project

i am able to import only the project created in vb.net and not the 1 converted to .net

any idea what could cause this??
thnks
Again, you do NOT import projects. Projects are referenced. You import namespaces. Presumably the namespace you think you want to import doesn't exist, or else is declred in an assembly you haven't referenced.
 
Back
Top