none
Put dlls in separate folder RRS feed

  • Question

  • Hello

    Is it possible to change the output path of the dlls to a different folder when building, at the moment allt projects goes into the same folder. I would like to have something like:

    MainApp.exe
    ApplicationFolder
    Project1.dll
    Project2.dll

    Thanks
    // Lasse
    Sunday, March 30, 2008 7:23 PM

Answers

  • Is there any reason you are not just putting a project reference?  Right click on the project in solution explorer and select add reference.  Click on the projects tab and select the other two projects.  If not you can put in a post build task to copy the dlls to the other folder.  Im using vs2008 so the steps my be slightly differnt if you are using a different version of vs.  Right click on the project and selection properties.  Go to the build event tab.  Click on postbuild events.  You can create some dos commands here that will run after the project has been compiled.  If you click on the macro button you can see all the different variables you can use.  Here is an example for you, just change MainProject to the name of the main project i guess.

    Copy $(OutDir)*.* $(SolutionDir)MainProject\$(OutDir)
    Sunday, March 30, 2008 11:49 PM

  • Hi LasseJ,

    The Term used for your problem statement is called Assembly Probing

    Are you using Windows Application?
    if so,

    in the app.config file

    try to add the following tags in it under <configuration>

    Code Snippet

    <runtime>
    <assemblyBinding xmlns="urnTongue Tiedchemas-microsoft-com:asm.v1">
    <!-- Here is the subdirectory name of the directory of Main Application Executable Resides -->
    <probing privatePath="Library" />
    </assemblyBinding>
    </runtime>

    In mycase, I used Libary Folder instead of Application Folder

    Tuesday, April 1, 2008 8:30 PM

All replies

  • Is there any reason you are not just putting a project reference?  Right click on the project in solution explorer and select add reference.  Click on the projects tab and select the other two projects.  If not you can put in a post build task to copy the dlls to the other folder.  Im using vs2008 so the steps my be slightly differnt if you are using a different version of vs.  Right click on the project and selection properties.  Go to the build event tab.  Click on postbuild events.  You can create some dos commands here that will run after the project has been compiled.  If you click on the macro button you can see all the different variables you can use.  Here is an example for you, just change MainProject to the name of the main project i guess.

    Copy $(OutDir)*.* $(SolutionDir)MainProject\$(OutDir)
    Sunday, March 30, 2008 11:49 PM
  • Sorry it didn't answer my question, I'm using project references but when compiling it puts the referred dll's directly in the Debug/Release folder i want to have them in a subfolder named data.

    Thanks
    // Lasse
    Tuesday, April 1, 2008 1:39 PM

  • Hi LasseJ,

    The Term used for your problem statement is called Assembly Probing

    Are you using Windows Application?
    if so,

    in the app.config file

    try to add the following tags in it under <configuration>

    Code Snippet

    <runtime>
    <assemblyBinding xmlns="urnTongue Tiedchemas-microsoft-com:asm.v1">
    <!-- Here is the subdirectory name of the directory of Main Application Executable Resides -->
    <probing privatePath="Library" />
    </assemblyBinding>
    </runtime>

    In mycase, I used Libary Folder instead of Application Folder

    Tuesday, April 1, 2008 8:30 PM
  • In addintion to assembly probing configuration, you can also modify the output path of the referenced project. For more details, please visit Build Page, Project Designer (C#)\ - Output path.
    Wednesday, April 2, 2008 5:30 AM
  • I actually don't need to communicate with the files in the App folder I just want Visual Studio to put them in the App folder instead of directly in the Debug folder as it does when I refer to them.

    I also want it to enable debugging of the files automatically.
    Wednesday, April 2, 2008 5:26 PM