locked
new and existing projects with NugetPackages and packagereference format in "isolated" build server RRS feed

  • Question

  • User-745244032 posted

    hi there,

    We have a build server that cannot reach the internet, and therefore cannot "restore" nugget packages.

    There are NUMEROUS resources on ABANDONING package references from TFS, however we appear to need the exact opposite of what is suggested here and too many other places.https://docs.microsoft.com/en-us/nuget/consume-packages/packages-and-source-control

    Is there some workflow for including packages in source control (so that the dev machines are responsible for downloading the package and getting it to the build server, somehow...

    I feel that its POSSIBLY as simple as manually adding all the references into TFS, but we need a process that is reliable and not obscure...

    Monday, December 10, 2018 5:10 AM

Answers

  • User283571144 posted

    Hi noJedi,

    As far as I know, we could try to publish the package to the TFS ,then you could try to modify the package sources to get the pakcage instead of the nuget package offical url.

    More details, you could refer to below article:

    https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-nuget?view=vsts&tabs=new-nav 

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 11, 2018 8:49 AM
  • User-745244032 posted

    Ironically, I had looked at that (Packages Manger in tfs2017) but dismissed it because (since server is off line can't "refer to upstream") I didn't think it was for public packages only private. We feel this will mean - changing to a three step process of:

    1. "finding a package" then
    2. adding it to this package manager and THEN
    3. using it in our projects...? (EDIT: no as long as the package is "right" the Nuget system will still find the right package if its configured to look in the right places - packages must have a guid or something to ID them independently of "origin" - so there is no NEED to switch repositories in VS/projects unless you want to RESTRICT what packages are available - eg: for business/process/policy reasons)

    clunky... but may work... (super clunky when you consider most NEW dotnet (core) project templates start out by grabbing a handful of packages... any idea how to identify tehse in order to have the placed in the right place, or is there someprocess of "just going to the \appdata\local\...\nugget cache and taking EVERYTHING from there and shoving that on the server with some "push *.nupkg" command...? 

    Is this the only/recommended way to do this?

    There's no way to include packages in TFS "by the sln/ide" somehow? Since I'm VERY used to seeing \packages\<all the packages active and old version> and \packages.config in the solution folder mostly, I'm no longer sure how thisworks in VS or "which cache" is the RIGHT source anyway!

    I guess what I'm trying to get to the bottom of is (given info here https://docs.microsoft.com/en-us/nuget/hosting-packages/overview - eg package manager/local feeds)

    its not "rocket science" to "get the files there" as long as you can (a) find the package and (b) get it into the folder structure that the SLN/Project/TFS/MSBuild is expecting when it goes "looking for missing package referneces and can't find them in the SLN/Build working folder...

    but the main question I need answers/advice on is

    1.  whats the process (especially in dotnetcore, but really any VS project - since everything seems to be "use package restore" afaik) for KNOWING what nugget packages are referenced that will be needed at build time? (my guess is everything that's not part of a .Net SDK... but again HOW to KNOW this?)?
    2.  whats the best/most manageable way to maintain this "listof  references  -> build server" process in day to day development/checking-in...?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 13, 2018 12:36 PM

All replies

  • User283571144 posted

    Hi noJedi,

    As far as I know, we could try to publish the package to the TFS ,then you could try to modify the package sources to get the pakcage instead of the nuget package offical url.

    More details, you could refer to below article:

    https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-nuget?view=vsts&tabs=new-nav 

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 11, 2018 8:49 AM
  • User-745244032 posted

    Ironically, I had looked at that (Packages Manger in tfs2017) but dismissed it because (since server is off line can't "refer to upstream") I didn't think it was for public packages only private. We feel this will mean - changing to a three step process of:

    1. "finding a package" then
    2. adding it to this package manager and THEN
    3. using it in our projects...? (EDIT: no as long as the package is "right" the Nuget system will still find the right package if its configured to look in the right places - packages must have a guid or something to ID them independently of "origin" - so there is no NEED to switch repositories in VS/projects unless you want to RESTRICT what packages are available - eg: for business/process/policy reasons)

    clunky... but may work... (super clunky when you consider most NEW dotnet (core) project templates start out by grabbing a handful of packages... any idea how to identify tehse in order to have the placed in the right place, or is there someprocess of "just going to the \appdata\local\...\nugget cache and taking EVERYTHING from there and shoving that on the server with some "push *.nupkg" command...? 

    Is this the only/recommended way to do this?

    There's no way to include packages in TFS "by the sln/ide" somehow? Since I'm VERY used to seeing \packages\<all the packages active and old version> and \packages.config in the solution folder mostly, I'm no longer sure how thisworks in VS or "which cache" is the RIGHT source anyway!

    I guess what I'm trying to get to the bottom of is (given info here https://docs.microsoft.com/en-us/nuget/hosting-packages/overview - eg package manager/local feeds)

    its not "rocket science" to "get the files there" as long as you can (a) find the package and (b) get it into the folder structure that the SLN/Project/TFS/MSBuild is expecting when it goes "looking for missing package referneces and can't find them in the SLN/Build working folder...

    but the main question I need answers/advice on is

    1.  whats the process (especially in dotnetcore, but really any VS project - since everything seems to be "use package restore" afaik) for KNOWING what nugget packages are referenced that will be needed at build time? (my guess is everything that's not part of a .Net SDK... but again HOW to KNOW this?)?
    2.  whats the best/most manageable way to maintain this "listof  references  -> build server" process in day to day development/checking-in...?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 13, 2018 12:36 PM
  • User283571144 posted

    Hi noJedi,

    Since this issue now is mainly talking about the TFS,  I suggest you could also post this issue on the stackoverflow forum TFS tag.

    https://stackoverflow.com/search?q=TFS 

    Best Regards,

    Brando

    Friday, December 14, 2018 2:28 AM
  • User-745244032 posted

    Marking both as answer even though there is not a solid answer from this.

    I will post more in a TFS forum, but this is one of those weird issues that straddles IDE/SourceControl/workflow and organizational needs/best practices/practical/pragmatic guidances and probably more...

    Thanks for your input, hopefully another forum will guide me further, thanks.

    Friday, December 14, 2018 5:03 AM