switcher
Switch .csproj references between NuGet packages and local projects using a JSON config
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Switch .csproj references between NuGet packages and local projects using a JSON config
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
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.