Question

I have WPF assembly with a bunch of other dlls in my project

I want to move everything except the main assembly and the app.config from the build directory to a subdirectory called bin

this is easy when I add the probing tag to my app.config and do it manually (a cut and paste job)

<configuration>
  <connectionStrings>
    <add name="ConnectionString" connectionString="..." />    
  </connectionStrings>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin"/>
    </assemblyBinding>
  </runtime>
</configuration>

What i want to do now is automatically move everything that's not the assembly into the bin directory at the end of my build.

so from this

App.exe
App.config
Domain.dll
Application.dll
Framework.dll

to this

App.exe
App.config
bin\Domain.dll
bin\Application.dll
bin\Framework.dll

I'm guessing I could use a bat files with a bunch of move commands in it but i was hoping that there was something a bit more reusable and intelligent than that out there.

Was it helpful?

Solution

For anyone interested what I ended up doing was this

a Post Build Event that looks like this

move $(TargetDir)$(TargetName).* .\..

and I set the build directory to be the actual sub directory so it looked like

[Path to Project]\bin\Release\bin

So instead of working out what to move down a directory (which could be a whole bunch of things) I just took the bits I know I want up a directory.

Big smiley face for me Hooray!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top