开发者

Post Build event that puts all extra .dlls in bin directory using probing

I have WPF assembly with a bunc开发者_如何学Goh 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.


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜