
.NET project locking/loading DLL created by other .NET project
the C# (and VB) project system does not robustly support changing the output
directory to a common location. it most often results in project outputs
being 'locked' and thus not being able to build the solution. sometimes this
is intermittent, other times it happens consistently. i suggest that you
work around the problem by letting the C# project build into its own
directory and doing the copies later. in fact, i would recommend *never*
changing the output directory of a C# project (also *never* setting the
"copy local" property on a reference in a C# project, as this can cause
similar problems). let the project system do its copying of files and then
place the files where you need them after the build. i know, it's annoying
that it creates all these seemingly un-needed copies, but it does them for a
reason and trying to work around them generally breaks things :(
(there is another known issue that causes locking with having the object
browser open with project-to-project references and the C# project system.
close the object browser to work around this).
josh
Quote:
> I've got a .NET DLL I'm creating with MC++. This DLL is used by two
> "client" projects; one in C# and the other in VB.NET. All three projects
> are in the same solution for convenience. Because of distribution
> requirements, I need to have the MC++ project output it's DLL into a
> specific directory (for instance "MyDir"). Then, I need to have the other
> two client projects output their EXEs into the MyDir directory, AND
> reference the MC++ produced DLL in MyDir. (I don't want to do a
post-build
> copy of targets to achieve this.)
> Here is the problem. I can build the DLL and the client projects just
fine.
> All of the targets end up in MyDir as planned by changing the project's
> various output path/directory settings. The problem is after I build
either
> of the client projects they appear to keep the referenced DLL loaded. So,
> if I try to compile the DLL again (via the MC++ project) I get the error
> "fatal error LNK1104: cannot open file <my Dll>". I thought the 'Copy
> Local' property in the client projects, of my referenced DLL, set to true
> was causing this issue, but setting it to false did not help.
> Is there any way to force the client projects to unload the referenced DLL
> immediately after compilation? (Note: We're compiling these projects via
> the command line.) I understand the client projects must load the DLL to
> resolve symbols for their own compilation, it just seems an annoyance that
> they don't unload afterwards.
> Thanks,
> Tim Rogers