none
Nuget Config - repository path - multiple locations

    Question

  • Hi,

    I have a requirement where I need nuget packages installed based on the TFS branch I am working at that time. I edited nuget.config and added the key "repositoryPath" with value "..\Solution1\DEV\Source\Packages". However, this path should change to "..\Solution1\MAIN\Source\Packages" when I am working on MAIN branch of TFS.

    So, I want the path referred to something like "..\Solution1\*\Source\Packages" so that it can be any of DEV/MAIN/RELEASE tfs branches.

    Is it possible to use any regex as shown above? Or, is there any workaround for this?

    Thank you!


    Surya Praveen

    Friday, May 27, 2016 12:45 PM

Answers

  • Hi Surya Praveen,

    >>I edited nuget.config and added the key "repositoryPath" with value "..\Solution1\DEV\Source\Packages". However, this path should change to "..\Solution1\MAIN\Source\Packages" when I am working on MAIN branch of TFS.

    >>So, I want the path referred to something like "..\Solution1\*\Source\Packages" so that it can be any of DEV/MAIN/RELEASE tfs branches.

    For the tag "repositoryPath" in the repositoryPath, we can use an absolute path or a relative path, but to use the regex, as far as I know, it is hard to achieve it. Maybe you would think about other ways.

    This thread shared us some workarounds:

    http://stackoverflow.com/questions/18376313/setting-up-a-common-nuget-packages-folder-for-all-solutions-when-some-projects-a

    Maybe you could refer to them.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 31, 2016 9:54 AM
    Moderator

All replies

  • Hi  Surya Praveen,

    Thank you for your post.

    This forum is discuss Visual Studio setup and installation.

    As your issue is related to visual studio general question, I help you move this case to Visual Studio general questionsforum for dedicated support.

    Thank you for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Monday, May 30, 2016 7:10 AM
    Moderator
  • Hi Surya Praveen,

    >>I edited nuget.config and added the key "repositoryPath" with value "..\Solution1\DEV\Source\Packages". However, this path should change to "..\Solution1\MAIN\Source\Packages" when I am working on MAIN branch of TFS.

    >>So, I want the path referred to something like "..\Solution1\*\Source\Packages" so that it can be any of DEV/MAIN/RELEASE tfs branches.

    For the tag "repositoryPath" in the repositoryPath, we can use an absolute path or a relative path, but to use the regex, as far as I know, it is hard to achieve it. Maybe you would think about other ways.

    This thread shared us some workarounds:

    http://stackoverflow.com/questions/18376313/setting-up-a-common-nuget-packages-folder-for-all-solutions-when-some-projects-a

    Maybe you could refer to them.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 31, 2016 9:54 AM
    Moderator