none
Is there a solution extraction tool?

    Question

  • Is there a solution extraction tool that can take a solution with all of its projects with development code (i.e. C#, XAML, HTML...) and supporting libraries (i.e. NuGets) and without all the temporary files and binaries to a different set of folders which could be re-built if necessary?

    Sunday, January 29, 2017 3:58 PM

All replies

  • An approach would be to set for each project of the solution the Output folder (bin) and Intermediate Folder (obj) at the same level of the source folder:

    - Solution folder

    --- "Source" folder

    --- "Bin" folder

    --- "Obj" folder

    Where the "Source" folder contains the .sln file and the "packages" folder for NuGet. Then you can copy the Solution > Source folder to somewhere and build again.

    To set the Output (Bin) folder of a project is done in the Project properties for each configuration/platform (Debug, Release, etc.), using ..\..\.. until you reach the desired folder level.

    To set the Intermediate (Obj) folder for a project requires to edit the .csproj file by hand and add the IntermediateOutputPath property for each Configuration/Platform.

    Example:

      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <OutputPath>..\..\Bin\Debug\</OutputPath>
        <IntermediateOutputPath>..\..\Obj\$(AssemblyName)\$(Configuration)\</IntermediateOutputPath>
    ...
      </PropertyGroup>


    My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com


    Sunday, January 29, 2017 9:48 PM
  • Hi AlaskanRogue,

    Has Carlos's reply helped you out?

    Feel free to let us know if you get any other issue.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 01, 2017 5:47 AM
  • Thanks Carlos for replying. I haven't had an opportunity to test. However, it appears that your answer would work for extracting a solution only if it had been built from the beginning with the suggested folder structure. What would you do for an existing solution to get it into that structure without breaking anything, i.e. extract it?
    Wednesday, February 01, 2017 11:29 AM
  • See my reply this morning.
    Wednesday, February 01, 2017 11:29 AM
  • Hi,

    If you haven't set that structure, then you must use a tool that deletes recursively from the root all the "Obj" and "Bin" folders, since they are not part of the source code. Then, the remaining folders are source code and can be copied to a different location.


    My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com

    Wednesday, February 01, 2017 11:37 AM
  • Can you recommend such a cleaning tool?
    Wednesday, February 01, 2017 12:11 PM
  • I don't have such tool, but you can create one with .NET or PowerShell

    My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com

    Wednesday, February 01, 2017 12:17 PM
  • Thanks Carlos. Was just trying to eliminate the effort required to do so. So I guess I am back to "Is there a solution extraction tool?"
    Wednesday, February 01, 2017 12:53 PM
  • Hi AlaskanRogue,

    Based on Carlos's suggestion, I think the cleaning tool like below could help you:

    https://github.com/doblak/ps-clean

    Best regards,

    Fletch

     


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 02, 2017 1:34 AM
  • Thanks Fletch. Will take a look.
    Thursday, February 02, 2017 11:29 AM
  • Hi AlaskanRogue,

    I hope it works.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 03, 2017 1:18 AM