Home All Groups Group Topic Archive Search About

Compiling VB (.NET) files located in different directories

Author
26 Jul 2006 5:32 AM
AA
Hi,
I am having to vb files. One is located under C:/VB/main and the other
is under C:/VB/class.
File under main looks like:

<code>
Module Module1
Sub Main()

Dim test As New Test1

End Sub

End Module
</code>
The class Test1 is defined in the file (class_test.vb) under class
directory. When I compile the code, I get an error saying Test1 is not
defined. This is because class_test.vb is located in some other
directory.
Any idea how this can be resolved? I want to main the directory
structure.

Regards,
P

Author
26 Jul 2006 6:59 AM
Cor Ligthert [MVP]
AA,

Use your Solution Explorer to create folders and don't use Window Explorer
for that.

Use the same Solution Explorer to move your classes inside that.

If you have done it with Windows Explorer than click in top of Solution
Explorer  the icon Show all files.
Than include the folders etc. what you need. Don't include things as the Bin
and Obj folder because than it is in use and can't make builds anymore in
it.

I hope this helps,


Cor

Show quoteHide quote
"AA" <puky***@gmail.com> schreef in bericht
news:1153891978.113126.90430@75g2000cwc.googlegroups.com...
> Hi,
> I am having to vb files. One is located under C:/VB/main and the other
> is under C:/VB/class.
> File under main looks like:
>
> <code>
> Module Module1
> Sub Main()
>
> Dim test As New Test1
>
> End Sub
>
> End Module
> </code>
> The class Test1 is defined in the file (class_test.vb) under class
> directory. When I compile the code, I get an error saying Test1 is not
> defined. This is because class_test.vb is located in some other
> directory.
> Any idea how this can be resolved? I want to main the directory
> structure.
>
> Regards,
> P
>
Author
26 Jul 2006 8:23 AM
AA
It worked, great!!!
I have one more question: Like in C, for every file we get an .obj
created. All these object files then get linked to the final dll/exe.
Is there a similar process in VB.NET? What I mean by this is; is there
a way that I can build each folder individually and then combine
everything to get my final exe?

Regards,
AA

Cor Ligthert [MVP] wrote:
Show quoteHide quote
> AA,
>
> Use your Solution Explorer to create folders and don't use Window Explorer
> for that.
>
> Use the same Solution Explorer to move your classes inside that.
>
> If you have done it with Windows Explorer than click in top of Solution
> Explorer  the icon Show all files.
> Than include the folders etc. what you need. Don't include things as the Bin
> and Obj folder because than it is in use and can't make builds anymore in
> it.
>
> I hope this helps,
>
>
> Cor
>
> "AA" <puky***@gmail.com> schreef in bericht
> news:1153891978.113126.90430@75g2000cwc.googlegroups.com...
> > Hi,
> > I am having to vb files. One is located under C:/VB/main and the other
> > is under C:/VB/class.
> > File under main looks like:
> >
> > <code>
> > Module Module1
> > Sub Main()
> >
> > Dim test As New Test1
> >
> > End Sub
> >
> > End Module
> > </code>
> > The class Test1 is defined in the file (class_test.vb) under class
> > directory. When I compile the code, I get an error saying Test1 is not
> > defined. This is because class_test.vb is located in some other
> > directory.
> > Any idea how this can be resolved? I want to main the directory
> > structure.
> >
> > Regards,
> > P
> >
Author
26 Jul 2006 9:06 AM
Cor Ligthert [MVP]
AA,

It is better to place for every question a seperate message. Now I am
probably only answering and maybe there are some who can give a better
answer. However,

You can create libararys (DLL) and use those in your programs.
Project->Add References -> browse and than point to the created DLL

You can as well add those libarary projects to your VB project just as you
want and than is the reference.
Project-> Add References -> Projects

I hope this helps,

Cor

Show quoteHide quote
"AA" <puky***@gmail.com> schreef in bericht
news:1153902237.580620.158250@s13g2000cwa.googlegroups.com...
> It worked, great!!!
> I have one more question: Like in C, for every file we get an .obj
> created. All these object files then get linked to the final dll/exe.
> Is there a similar process in VB.NET? What I mean by this is; is there
> a way that I can build each folder individually and then combine
> everything to get my final exe?
>
> Regards,
> AA
>
> Cor Ligthert [MVP] wrote:
>> AA,
>>
>> Use your Solution Explorer to create folders and don't use Window
>> Explorer
>> for that.
>>
>> Use the same Solution Explorer to move your classes inside that.
>>
>> If you have done it with Windows Explorer than click in top of Solution
>> Explorer  the icon Show all files.
>> Than include the folders etc. what you need. Don't include things as the
>> Bin
>> and Obj folder because than it is in use and can't make builds anymore in
>> it.
>>
>> I hope this helps,
>>
>>
>> Cor
>>
>> "AA" <puky***@gmail.com> schreef in bericht
>> news:1153891978.113126.90430@75g2000cwc.googlegroups.com...
>> > Hi,
>> > I am having to vb files. One is located under C:/VB/main and the other
>> > is under C:/VB/class.
>> > File under main looks like:
>> >
>> > <code>
>> > Module Module1
>> > Sub Main()
>> >
>> > Dim test As New Test1
>> >
>> > End Sub
>> >
>> > End Module
>> > </code>
>> > The class Test1 is defined in the file (class_test.vb) under class
>> > directory. When I compile the code, I get an error saying Test1 is not
>> > defined. This is because class_test.vb is located in some other
>> > directory.
>> > Any idea how this can be resolved? I want to main the directory
>> > structure.
>> >
>> > Regards,
>> > P
>> >
>
Author
26 Jul 2006 12:45 PM
AA
Yes, it did help a lot. I created a class library, built a dll from
that and added that in Project->References. In my main.vb, I am
instantiating object of that class (embedded in the dll) as
Dim class_object As DllName.ClassName

thanks a lot for your help.
AA
Cor Ligthert [MVP] wrote:
Show quoteHide quote
> AA,
>
> It is better to place for every question a seperate message. Now I am
> probably only answering and maybe there are some who can give a better
> answer. However,
>
> You can create libararys (DLL) and use those in your programs.
> Project->Add References -> browse and than point to the created DLL
>
> You can as well add those libarary projects to your VB project just as you
> want and than is the reference.
> Project-> Add References -> Projects
>
> I hope this helps,
>
> Cor
>
> "AA" <puky***@gmail.com> schreef in bericht
> news:1153902237.580620.158250@s13g2000cwa.googlegroups.com...
> > It worked, great!!!
> > I have one more question: Like in C, for every file we get an .obj
> > created. All these object files then get linked to the final dll/exe.
> > Is there a similar process in VB.NET? What I mean by this is; is there
> > a way that I can build each folder individually and then combine
> > everything to get my final exe?
> >
> > Regards,
> > AA
> >
> > Cor Ligthert [MVP] wrote:
> >> AA,
> >>
> >> Use your Solution Explorer to create folders and don't use Window
> >> Explorer
> >> for that.
> >>
> >> Use the same Solution Explorer to move your classes inside that.
> >>
> >> If you have done it with Windows Explorer than click in top of Solution
> >> Explorer  the icon Show all files.
> >> Than include the folders etc. what you need. Don't include things as the
> >> Bin
> >> and Obj folder because than it is in use and can't make builds anymore in
> >> it.
> >>
> >> I hope this helps,
> >>
> >>
> >> Cor
> >>
> >> "AA" <puky***@gmail.com> schreef in bericht
> >> news:1153891978.113126.90430@75g2000cwc.googlegroups.com...
> >> > Hi,
> >> > I am having to vb files. One is located under C:/VB/main and the other
> >> > is under C:/VB/class.
> >> > File under main looks like:
> >> >
> >> > <code>
> >> > Module Module1
> >> > Sub Main()
> >> >
> >> > Dim test As New Test1
> >> >
> >> > End Sub
> >> >
> >> > End Module
> >> > </code>
> >> > The class Test1 is defined in the file (class_test.vb) under class
> >> > directory. When I compile the code, I get an error saying Test1 is not
> >> > defined. This is because class_test.vb is located in some other
> >> > directory.
> >> > Any idea how this can be resolved? I want to main the directory
> >> > structure.
> >> >
> >> > Regards,
> >> > P
> >> >
> >