Question from .net beginner regarding rebuilding custom class library

J

jz3

I have two vb.net projects, one that creates a class library and
another that uses ("consumes") the class library. Whenever I rebuild
the class library project then use it in the consumer project the
consumer project won't compile unless I delete the reference to the
class library in the consumer project then re-add the reference. This
is time consuming and error-prone.
? Is there a better way to handle this situation ?
Thanks
 
J

Jon Skeet [C# MVP]

I have two vb.net projects, one that creates a class library and
another that uses ("consumes") the class library. Whenever I rebuild
the class library project then use it in the consumer project the
consumer project won't compile unless I delete the reference to the
class library in the consumer project then re-add the reference. This
is time consuming and error-prone.
? Is there a better way to handle this situation ?

When you say it "won't compile" that suggests there's an error message.
What's the error message? Is it something to do with a version
mismatch? If so, you could potentially change the reference properties
so that "Use specific version" is set to False.
 
J

jz3

When you say it "won't compile" that suggests there's an error message.
What's the error message? Is it something to do with a version
mismatch? If so, you could potentially change the reference properties
so that "Use specific version" is set to False.

------------------------------------------------
Thanks for your reply. The compile error I got said that it (Visual
Studio 2005) couldn't locate the class library class that was being
referenced in the consumer project. However, after doing some routine
work in the class library project the compile error in the consumer
project disappeared. The only thing I did was to set the output path
of the class library project to the bin directory of the consumer
project where the consumer project was looking for the dll. I don't
know if that's what fixed the error or not, but the error has gone
away nevertheless. I may run into the problem again in the future and
if I do I'll take a look at the "Use specific version" setting.
Thanks Again.
 
J

Jon Skeet [C# MVP]

Thanks for your reply. The compile error I got said that it (Visual
Studio 2005) couldn't locate the class library class that was being
referenced in the consumer project. However, after doing some routine
work in the class library project the compile error in the consumer
project disappeared. The only thing I did was to set the output path
of the class library project to the bin directory of the consumer
project where the consumer project was looking for the dll.

Ooh, not a good idea. You want to keep those separate.
I don't
know if that's what fixed the error or not, but the error has gone
away nevertheless. I may run into the problem again in the future and
if I do I'll take a look at the "Use specific version" setting.
Thanks Again.

Where did you reference the DLL from before? You should just use the
output directory of the class library.

I've sometimes found that VS2005 doesn't set the hint path for
assemblies properly - edit the project file by hand to set this
appropriately if necessary.
 

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