Within a Project, if I use NuGetReferenceSwitcher to switch from a NuGet to a Project Reference for NuGet Package X, and then use NuGetReferenceSwitcher to revert back to the NuGet reference, the .csproj file has an extra line added immediately following the <ItemGroup> ,<Reference Include="X"> nodes as follows:
<SpecificVersion>False</SpecificVersion>
I would expect the csproj file to remain completely unchanged after reverting back to the original NuGet package reference.
Coding fix was to modify ProjectModel.AddReference() to reset the SpecificVersion flag to true.
// ReSharper disable once SuspiciousTypeConversion.Global
if (_vsProject.References.Add(assemblyPath) is Reference4 reference)
{
reference.SpecificVersion = true;
}
where Reference4 is a new Interface I created following the instructions here
Within a Project, if I use NuGetReferenceSwitcher to switch from a NuGet to a Project Reference for NuGet Package X, and then use NuGetReferenceSwitcher to revert back to the NuGet reference, the .csproj file has an extra line added immediately following the
<ItemGroup>
,<Reference Include="X">
nodes as follows:<SpecificVersion>False</SpecificVersion>
I would expect the csproj file to remain completely unchanged after reverting back to the original NuGet package reference.
Coding fix was to modify ProjectModel.AddReference() to reset the SpecificVersion flag to true.
where
Reference4
is a new Interface I created following the instructions hereSetting the properties of a reference programmatically