views:

81

answers:

2

I have this structure:

Projects
|-bin
|-Project1
|-Project2
.....|-crapBin

When I build my solution from project1+2 all the built binaries goes into the bin. But additionally some binaries are also put into the crapBin folder although I have not set this path as output path of any project. Furthermore I have not defined any pre/post build events etc...

What is wrong?

A: 

Edit (Completely reworked, refined, improved answer):

With some experimentation I noticed this: When I enter the output folder as "binFoo\Debug\" and "binFoo\Release\" respectively, I get the additional folder as well.

However, when I enter them as ".\binFoo\Debug\" and ".\binFoo\Release" and save the project properties then the additional folder will no longer be created in my environment. Note that as soon as you re-open the project properties the entries for the output folder no longer show the leading ".\". However, from then onwards it builds into the new folder.

I tested this with creating one solution and then adding two C# class library projects to that solution.

Good luck with the hunt!

John
all projects in C# with VS2008.
msfanboy
Well I built every project individually to check who creates the crapBin. Then I checked its .csproj file but under the Mode Debug there is my proper bin path. Only under other modes like Release etc... there is the old path. But when I build my solution its mode is set to debug, so it should go only into the bin folder... :/
msfanboy
In that case I agree with Satanlike's answer. In that case, however, the additional folder should be empty. Remove the files you have there and recompile. If they reappear then either VS copies the files and doesn't remove them from the additional, or there is something in the projects/solution that keeps them there.
John
@msfanboy: I updated my answer as I did some more experimentation and it now works in my case.
John
+1  A: 

VS2008 always compiles into the ProjectXXX\bin folder and copies the component after a successfull build to the output directory which you specify in the project properties.

------ Build started: Project: TestProject, Configuration: Debug x86 ------ C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 ...

Compile complete -- 0 errors, 0 warnings c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2606,9): error MSB3021: Unable to copy file "obj\x86\Debug\TestProject.dll" to "C:\OutputDirectory\TestProject.dll". The process cannot access the file 'C:\OutputDirectory\TestProject.dll' because it is being used by another process.

Done building project "TestProject.csproj" -- FAILED.

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Satanlike
do you have a msdn source link for that behavior?
msfanboy
it's a behavior I see every time I want to build a component which is currently locked in the output directory. I added a message from the output window to prove this.
Satanlike
@Satanlikedon`t beat me, but John`s answer was more useful to me, but I gave ya a point :)
msfanboy