switcher
Switch .csproj references between NuGet packages and local projects using a JSON config
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Switch .csproj references between NuGet packages and local projects using a JSON config
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
| name | switcher |
| description | Switch .csproj references between NuGet packages and local projects using a JSON config |
Switch .csproj references between NuGet PackageReference and local ProjectReference entries using a switcher.json configuration file. Useful when developing across multiple .NET solutions that depend on each other.
When the user asks to switch references between NuGet packages and local projects, run the following command:
dotnet run "${CLAUDE_SKILL_DIR}/switcher.cs" <to-project|to-nuget|status> <path-to-switcher.json>
${CLAUDE_SKILL_DIR} resolves to this skill's directory regardless of where it's installed. Replace <to-project|to-nuget|status> with the desired command and <path-to-switcher.json> with the path to the configuration file.
The switcher.json file defines which references can be switched and which .csproj targets to modify. All paths are relative to the config file's directory.
{
"references": [
{
"package": "Acme.Core",
"version": "2.1.0",
"project": "../acme-core/src/Acme.Core/Acme.Core.csproj"
}
],
"targets": [
"src/MyApp/MyApp.csproj"
]
}
references[].package — NuGet package name (matches <PackageReference Include="...">).references[].version — Version to restore when switching back to NuGet.references[].project — Path to the local .csproj for ProjectReference.targets[] — .csproj files to modify.| Command | Action |
|---|---|
to-project | Replace matching PackageReference entries with ProjectReference pointing at local source |
to-nuget | Replace matching ProjectReference entries with PackageReference (restores version and extra attributes) |
status | Report current state of each reference in each target — no file changes |
[OK] src/MyApp/MyApp.csproj :: Acme.Core → ProjectReference
[SKIP] src/MyApp/MyApp.csproj :: Acme.Logging (already switched)
[NUGET] src/MyApp/MyApp.csproj :: Acme.Core (v2.1.0)
[PROJECT] src/MyApp/MyApp.csproj :: Acme.Core (../acme-core/src/Acme.Core/Acme.Core.csproj)
Done. Switched: 1 | Skipped: 1 | Errors: 0
.csproj editing.dotnet available on the PATH.System.Text.Json and System.Xml.Linq.switcher.json config file describing the references and targets.switcher.json — unlisted references are not touched.Directory.Build.props or Directory.Packages.props (central package management).PackageReference (e.g. PrivateAssets, IncludeAssets) are preserved via XML comments and restored on round-trip, but only when the switch was performed by this tool.