Compiling Problems

R

Roberto Modica

Hi all,

I am trying to create a namespace hierachy but i think i
am doing something wrong.

I have an DAL vb file with the namespace:

CompanyName.newsletter.DAL

and i compile that using the standard vbc in command
prompt routine, and that works. then i try and create a
Business Layer vb file, with the namespace:

CompanyName.Newsletter.BLL

But for this to work i have to compile both files
together, even though i have imported the
CompanyName.newsletter.DAL namespace. What am i doing
wrong, as i want the two files to sit in two seperate
assemblies.

Please Help!

Rob
 
J

Jon Skeet [C# MVP]

Roberto Modica said:
I am trying to create a namespace hierachy but i think i
am doing something wrong.

I have an DAL vb file with the namespace:

CompanyName.newsletter.DAL

and i compile that using the standard vbc in command
prompt routine, and that works. then i try and create a
Business Layer vb file, with the namespace:

CompanyName.Newsletter.BLL

But for this to work i have to compile both files
together, even though i have imported the
CompanyName.newsletter.DAL namespace. What am i doing
wrong, as i want the two files to sit in two seperate
assemblies.

Are you *referencing* the assembly containing
CompanyName.newsletter.DAL when you compile the second one? Importing a
namespace isn't the same thing as referencing an assembly.
 
R

RM82

Hi Jon,

I dont think i am! could you point me to some article(s) or give me some
advice on how i could do this please.

Rob
 
J

Jon Skeet [C# MVP]

I dont think i am! could you point me to some article(s) or give me some
advice on how i could do this please.

In the "References" part of the project, click on Add Reference. Go to
the Projects tab, and select the project you want to add a reference
to.
 
R

RM82

Hi Again John,

i am not using Visual Studio.Net so how would i add referencing without
it??

Rob
 
J

Jon Skeet [C# MVP]

i am not using Visual Studio.Net so how would i add referencing without
it??

Sorry - I misread your previous post!

Use the /r command line parameter to add a reference, e.g.

vbc /r:Foo.dll ... (the other arguments)
 
R

RM82

I have tried that before,

i have created a assembly called:

Newsletter.DAL.dll and placed it into my Bin directory(application
wide), i have even placed it in a bin directory which sits in the same
directory as my business component:

so i add the /r:newsletter.data.dll line to my vbc and it returns an
error:

Command Line Error BC2017: Could Not Find Library 'newsletter.Data.dll"

my command line is:

vbc /t:library /out:newsletter.dll *.vb /r:system.dll /r:system.data.dll
/r:system.xml.dll /r:system.web.dll /r:newsletter.data.dll

am i doing something wrong.

Rob
 
J

Jon Skeet [C# MVP]

I have tried that before,

i have created a assembly called:

Newsletter.DAL.dll and placed it into my Bin directory(application
wide), i have even placed it in a bin directory which sits in the same
directory as my business component:

so i add the /r:newsletter.data.dll line to my vbc and it returns an
error:

Command Line Error BC2017: Could Not Find Library 'newsletter.Data.dll"

my command line is:

vbc /t:library /out:newsletter.dll *.vb /r:system.dll /r:system.data.dll
/r:system.xml.dll /r:system.web.dll /r:newsletter.data.dll

am i doing something wrong.

Yes - if you've placed it in your bin directory, you need to use

/r:bin\newsletter.data.dll

I suspect you don't need to add the other references though - they're
probably added automatically. (They are in C#, at least.)
 
R

RM82

Hi there,

took them out and still the same. i am at my wits end i really am, two
days to compile something!! any websites i could look at or any further
advice i am going mad here!

Rob
 
R

RM82

Ignore my last post!! thanks John for all you help! it was the reference
pointing to the bin dir thanks so much!!

Rob
 

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