From 8f411487560e4054d7f70bd5943c90a2e5f172b0 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Fri, 3 Jul 2026 02:03:17 +0900 Subject: [PATCH] fix: remove duplicate AddAdditionalAssemblies - same assembly already loaded by MapRazorComponents Problem: 'Assembly already defined' error when AddAdditionalAssemblies registers the same assembly twice - MapRazorComponents() automatically loads TaxBaik.Web.Client assembly - All Page/Shared components in same assembly are auto-discovered - AddAdditionalAssemblies with same assembly causes duplicate registration error Solution: Remove AddAdditionalAssemblies - not needed for components in same assembly This fixes the ObjectDisposedException crash on deployment. Co-Authored-By: Claude Haiku 4.5 --- TaxBaik.Web/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TaxBaik.Web/Program.cs b/TaxBaik.Web/Program.cs index e5ed653..ad96f0e 100644 --- a/TaxBaik.Web/Program.cs +++ b/TaxBaik.Web/Program.cs @@ -392,10 +392,11 @@ app.MapStaticAssets(); // Phase 8: WebAssembly 렌더 모드 완전 마이그레이션 // - App.razor: TaxBaik.WasmClient (호스트, WebAssembly) // - Routes + Pages + Shared + Layout + Forms: TaxBaik.WasmClient (WebAssembly) -// AddAdditionalAssemblies는 필수: App.razor만으로는 모든 라우트된 컴포넌트를 찾을 수 없음 +// MapRazorComponents는 자동으로 root 컴포넌트의 어셈블리 로드 +// 동일 어셈블리의 Page/Shared 컴포넌트는 자동 발견되므로 AddAdditionalAssemblies 불필요 +// (같은 어셈블리를 2번 등록하면 "Assembly already defined" 에러 발생) app.MapRazorComponents() .AddInteractiveWebAssemblyRenderMode() - .AddAdditionalAssemblies(typeof(TaxBaik.WasmClient._Imports).Assembly) .AllowAnonymous(); // 애플리케이션 시작/종료 로깅