Problems copying output dll's in a post build step

W

WineNCheese

I have a solution that has several projects, where many of the projects
contain controls that are discovered at runtime, rather than direct
reference (this is a requirement). Therefore, the 'copy local' reference
copy mechanism for of visual studio does not apply.

My first attempt at setting up the solution was to set the output directory
for the projects to a common directory. This did not work for the common
dll's that are referenced by several projects because the dll is locked,
presumeably because of intellisense. This was a while ago, so I don't
remember all the exact problems, but they all had to do with projects being
in use, preventing me to build.

My second attempt (and current) is to let each project have its own output
directory, and also copy the output in a post build step to a bin directory.
This works most of the time. However, occasionally, the post build step
will fail for some projects will fail, claiming the dll is locked -
presumeably for the same reason as my first attempt. Why this sometimes
works, and others not, I have no idea.

My question: is there any way to reliably setup a solution so that I can
copy
the output assembly after it builds to another location. It seems like a
simple
need, doesn't it?


Thanx...
 
W

WineNCheese

Clarification:

Project A - no references.
Project B - references project A
Project C - references project A
Project D - references project A, uses project B and C without direct
reference to the assembly (runtime discovered).

1. I cannot setup the projects to all have the same output directory,
because each project tries to copy Project A's dll to the same location,
which cannot be done because it is locked by intellisense. Is there a way
to avoid this problem while still having the same output directory?

2. I could setup the projects to have their own local ouputs, and create
post build steps to copy the output dll's and all references to the ultimate
output directory. However, then I can't run the app from devstudio.

3. I could setup all projects EXCEPT the executable to copy their outputs to
the ultimate location, and set the output directory for the executable
project to that directory. However, then the referenced dll's from the
executable project will be copied there as well. Then, after the first
build, these referenced assemblies' post build steps to copy their output
will fail because intellisense has locked the version from the main
executable. (this is my current situation).

What can I do?

Thanx...
 
W

WineNCheese

All right, here's a solution, albeit not a pretty one...

All the projects referenced (directly or indirectly) by the executable do
not copy their output anywhere. Then, scenario C works.

Someone at Microsoft - Is there any way to prevent the locking of my project
output so I can't manipulate it? This is quite annoying.

WNC
 

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