davidfowl/NuGetPowerTools — Issue #19: Enable-PackageRestore poisons projects for use in other solutions
Author: DuctTapeMan
Created: 2012-02-03 20:09:49+00:00
State: open

If you have a repository with one primary solution, and other secondary solutions in subfolders, using Enable-PackageRestore on the primary solution causes the shared projects to be unloadable in the subfolder solutions.

Example:

- nuget\
- PrimarySolution.sln
- Components
- Components.csproj
- Utilities
- UtilitySolution.sln

PrimarySolution and UtilitySolution both reference Components.csproj. So after enabling PackageRestore on PrimarySolution, UtilitySolution can't load Components.csproj. It says:

> One or more projects in the solution were not loaded correctly. Please see the Output Window for details.

Trying to reload the unloaded Components.csproj results in:

> Unable to read the project file 'Components.csproj' {Path to csproj file}: The imported project "{PathToRepositoryRoot}\Utilities\.nuget\nuget.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Essentially, there is a difference between the Solution Directory and the Repository Root Directory in this case. Not sure if there's a way within the Visual Studio paradigm for this to be addressed, but I don't have the PowerShell skills necessary to check it out myself.