I've been converting our library projects to NuGet packages and hosting them on an internal NuGet Feed. This is working great and has cut down on developers re-creating helper classes and "reinventing the wheel". Another huge plus is that other teams now can consume "released" libraries from our projects. Basically it's been a huge win so far.

The only problem we're facing is local builds. What we would like to do is is test libraries in our consuming projects before pushing a build to the NuGet feed. We're running into a problem because the projects that are consuming these libraries are setup to use the local feed (package restore on the build server allows our main trunk to build with the latest "released" libraries).

Is there a way to have local builds pick up from a local repository? I've begun working on an after build task for the libraries that creates local package files. Using the NuGet.config I think I should be able to mask certain repositories and then mask the config files on the build server. My theory is that when using a local build the local repository should be picked up and on the build server the feed would be used.

Is this possible? Is there anyone else that has documented how to do this?

Here is the after build task I'm using for creating the local packages:

  <PropertyGroup>
    <PackOutputDir>$([System.IO.Path]::Combine($(SolutionDir), "..\Prerelease"))</PackOutputDir>
    <BuildSpecCommand>$(NuGetCommand) spec $(ProjectFileName) -force -NonInteractive -Verbosity detailed</BuildSpecCommand>
    <PackCommand>$(NuGetCommand) pack $(ProjectFileName) -OutputDirectory "$(PackOutputDir)"</PackCommand>
  </PropertyGroup>
  <Target Name="AfterBuild" Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <Exec Command="$(BuildSpecCommand)" LogStandardErrorAsError="true" Condition=" '$(OS)' == 'Windows_NT' " />
    <E
Edit
Report