Build DLL to a separate folder

前端 未结 1 1920
长情又很酷
长情又很酷 2020-12-24 10:14

First

There are several questions similar to this, but none have answers that solved my problem nor can I post in

相关标签:
1条回答
  • 2020-12-24 10:27

    I found the answer here and transcribed here for the case of the link die.

    In your App.config file, insert this:

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

    Then go to Project -> Properties --- right click in your Project, then in the ContextMenu select Properties.

    Now go to Build Events and add the following code inside the Post-build event command line text box (as you can see in the bellow image).

    ; Move all assemblies and related files to lib folder
    ROBOCOPY "$(TargetDir) " "$(TargetDir)lib\ " /XF *.exe *.config *.manifest /XD lib logs data /E /IS /MOVE
    if %errorlevel% leq 4 exit 0 else exit %errorlevel%
    

    After

    Build your project and say good bye to your OCD!

    0 讨论(0)
提交回复
热议问题