Post Build事件,使用探测将所有额外的.dll放在bin目录中

Pet*_*ter 0 visual-studio-2010 post-build-event probing

我的项目中有一堆其他dll的WPF程序集

我想将除主程序集和app.config之外的所有内容从构建目录移动到名为bin的子目录

当我将探测标记添加到我的app.config并手动执行时(剪切和粘贴作业),这很容易

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

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin"/>
    </assemblyBinding>
  </runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)

我现在要做的是在构建结束时自动将不是程序集的所有内容移动到bin目录中.

所以从这里

App.exe
App.config
Domain.dll
Application.dll
Framework.dll
Run Code Online (Sandbox Code Playgroud)

对此

App.exe
App.config
bin\Domain.dll
bin\Application.dll
bin\Framework.dll
Run Code Online (Sandbox Code Playgroud)

我猜我可以使用带有一堆移动命令的蝙蝠文件,但我希望有一些比那里有更多可重用和智能的东西.

Pet*_*ter 5

对于任何感兴趣的人我最终做的是这个

一个看起来像这样的Post Build事件

move $(TargetDir)$(TargetName).* .\..
Run Code Online (Sandbox Code Playgroud)

我将构建目录设置为实际的子目录,因此它看起来像

[Path to Project]\bin\Release\bin
Run Code Online (Sandbox Code Playgroud)

因此,我没有弄清楚在目录中移动的内容(可能是一大堆内容),我只是把我想知道的内容放在一个目录上.

万岁!我很高兴笑脸!