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

Re: Question from .net beginner regarding rebuilding custom class library consumer projects: by Jon

Jon
Thu Mar 13 11:53:01 CDT 2008

<jz3@blakereal.com> wrote:
> 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.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: Question from .net beginner regarding rebuilding custom class by jz3

jz3
Thu Mar 13 13:40:50 CDT 2008

On Mar 13, 12:53=A0pm, Jon Skeet [C# MVP] <sk...@pobox.com> wrote:
> =A0<j...@blakereal.com> wrote:
> > 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.
>
> --
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet=A0 Blog:http://ww=
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

------------------------------------------------
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.

Re: Question from .net beginner regarding rebuilding custom class library consumer projects: by Jon

Jon
Thu Mar 13 14:36:37 CDT 2008

<jz3@blakereal.com> wrote:
> > 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.

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.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk