title: Output directory when building a WCF project in Visual Studio
body: <p>I have a Visual Studio 2010 solution that is set to build in Debug x86. Visual Studio therefore sets the output path to \bin\x86\Debug, which seems logical enough.</p>
  
  <p>The solution contains about 50 projects; the start-up project is a WCF project.</p>
  
  <p>When I do a build, I would expect all output dlls to go to \bin\x86\Debug, as that is what is set in the project settings. But weirdly, I see dlls being created in bin\x86\Debug <strong>and</strong> in \bin. Why would Visual Studio put any dll in \bin if the output path is not set to that directory? It seems that all dlls go to \bin\x86\Debug, and all dlls <strong>except for the start-up project</strong> go into \bin. Any idea why it would do that? (We have other solutions that don't use WCF, and they don't have this problem.)</p>
  
  <p>The other annoyance is if I run the service from Visual Studio and then try to access my service in a web browser, by going to <a href="http://localhost:1240/MyService.svc" rel="noreferrer">http://localhost:1240/MyService.svc</a>, it doesn't work, because the start-up project dll is missing from /bin. I therefore have to manually copy this one dll from \bin\x86\Debug to \bin, so that all dlls are found and the service runs normally. (We could of course add a custom post-build step that does the copy, but you'd think there'd be a better way!)</p>
  
  <p>To those of you working on WCF projects, do you leave the output path at \bin\x86\Debug? (Perhaps there is a way to configure the service, eg in the web.config or .svc file, so that it knows the binaries are in \bin\x86\Debug instead of \bin?) Or do you change the output path to \bin so that you can run your service straight from Visual Studio? </p>