This sample is configured to automatically replace a nuget package dependency by its source code if it is available locally in the Dependencies directory by using the MSBuild Choose statement in the .csproj file. The steps below demonstrate how this functionaly works correctly in Visual Studio version 17.1.7, but fails in 17.2.1.
By default, after cloning this repository, the project DynamicDependencies restores an external nuget package reference, in this case Swashbuckle.AspNetCore.Swagger (but any nuget package will do). Opening the Visual Studio solution will prompt a warning that not all projects could be loaded. This behaviour is expected and is not a problem. The project that can't be loaded is a reference to the source code of the dependency which is not required when using the nuget package reference.
Now, we want to include the source code of the dependency:
- Close Visual Studio.
- Clone the Swashbuckle.AspNetCore source code from the git repository (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/README.md) into the directory Dependencies.
- Start Visual Studio and load the solution.
- In Visual Studio 17.1.7 the Swashbuckle dependency of the DynamicDependencies project has automatically switched to the local project reference and is correctly loaded.
- In Visual Studio 17.2.1 the Swashbuckle dependency of the DynamicDependencies project still references the nuget package.