CLI for switching between PackageReference and ProjectReference in project files.
Unlike other solutions, we use a permanent configuration.
Switching is done by selecting Debug/Release configuration.
PackageReferenceSwitcher prepares the solution and the projects for this.
- Add the package projects to the solution (search in folders will be added later)
- call
PackageReferenceSwitcher init "Path-To-Your-Solution.sln"
uninstall:
- call
PackageReferenceSwitcher remove "Path-To-Your-Solution.sln"
Add as external tool and use init "$(SolutionDir)$(SolutionFileName)"
as arguments.
To keep the packet versions up-to-date, use our tool 'UpdatePackageReferences'
before:
<ItemGroup>
<PackageReference Include="KsWare.VsFileEditor" Version ="0.1.0" />
</ItemGroup>
after init:
<ItemGroup>
<PackageReference Include="KsWare.VsFileEditor" Version="0.1.0" Condition="'$(Configuration)' == 'Release'" />
<ProjectReference Include="..\..\..\VsFileEditor\src\VsFileEditor\VsFileEditor.csproj" Condition="'$(Configuration)' == 'Debug'" />
</ItemGroup>
choose the one that suits you best
- NuGetReferenceSwitcher (RicoSuter) (Last Update 2015) marketplace VS 2019, GitHub
- NuGetReferenceSwitcher Fork (Last Update 2024) GitHub
- NuGetSwitcher (Last Update 2022) marketplace VS 2022, GitHub