원클릭으로
dotnet-shared-library-extraction
Extract shared code from a .NET Exe project into a class library for multi-project reuse
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Extract shared code from a .NET Exe project into a class library for multi-project reuse
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
How to implement async credential prompting with proper error handling across multiple implementations (console, MCP elicitation, etc.)
How to safely use MCP Elicitation (ElicitAsync) in .NET MCP servers
SOC 직업 분류 기준
| name | dotnet-shared-library-extraction |
| description | Extract shared code from a .NET Exe project into a class library for multi-project reuse |
| domain | architecture |
| confidence | high |
| source | earned: FinaryExport MCP architecture proposal |
When a .NET solution needs to share code between multiple executable projects (CLI, MCP server, web API), extract the shared code into a class library. This avoids referencing an Exe project (which drags in all its dependencies) and creates a clean dependency graph.
Keep the original RootNamespace on the new library. If the original project was FinaryExport with namespace FinaryExport, set <RootNamespace>FinaryExport</RootNamespace> on the new .Core library. This means zero using statement changes across the entire codebase — files physically move, namespaces don't.
Split ServiceCollectionExtensions. The original AddFinaryExport() becomes AddFinaryCore() in Core (registers only shared services). Each consuming project registers its own specializations (e.g., ICredentialPrompt implementation).
Interface stays in Core, implementations split by consumer. ICredentialPrompt in Core. ConsoleCredentialPrompt in CLI. EnvCredentialPrompt in MCP. Each host decides how credentials are collected.
Packages follow the code. If CurlImpersonate is used by Core code, the PackageReference goes on Core. Consuming projects get it transitively. Don't duplicate PackageReferences.
Validate with existing tests first. After extraction, the CLI project must build clean and all tests must pass before writing any new code. This is a refactoring gate.
Before: FinaryExport (Exe) → has everything
After: FinaryExport.Core (Library) → auth, api, models, infrastructure
FinaryExport (Exe) → CLI, export, console prompts → references Core
FinaryExport.Mcp (Exe) → MCP server, tools, env prompts → references Core
ConsoleCredentialPrompt has no business in a library that MCP references).