Skip to content

fix(build): hot-reload timestamp chỉ ở cấu hình DebugAcad (sửa CS0006 khi build Debug trong VS) - #41

Merged
Tmphi merged 1 commit into
mainfrom
fix/debugacad-hot-reload
Oct 16, 2026
Merged

Tmphi merged 1 commit into
mainfrom
fix/debugacad-hot-reload

Conversation

@Tmphi

@Tmphi Tmphi commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Vấn đề

Build Debug | Any CPU trong Visual Studio (Ctrl+Shift+B) lỗi:

CSC : error CS0006: Metadata file '...\bin\Debug\net48\CadCoreFramework_20261016_185612.dll' could not be found [CadCoreFramework.Testing.csproj]

Tên DLL gắn giờ (CadCoreFramework_yyyyMMdd_HHmmss) được tính lại mỗi lần MSBuild đọc project. VS build từng project riêng, nên Testing/Tests/Benchmarks đọc lại plugin vài giây sau và đi tìm một tên không tồn tại. Release không bị (tên cố định); x64 qua được là nhờ VS dùng lại kết quả đọc cũ.

Sửa

  • Debug ra CadCoreFramework.dll tên cố định, như Release.
  • Cấu hình mới DebugAcad giữ hot-reload (tên gắn giờ + PostBuild copy). Khai báo lại DEBUG, Optimize=false, DebugSymbols vì SDK chỉ tự đặt cho cấu hình tên "Debug".
  • .sln: thêm DebugAcad|x64 / DebugAcad|Any CPU → plugin DebugAcad|x64 + analyzer Debug; test, benchmark, HeadlessLab không build.
  • Tài liệu: README, R01, R06 §1, T01, T02 §2.1, T04 §2–§3, T06, T09 ADR-008, deck sinh lại, CHANGELOG. Nhắc NETLOAD file có gắn giờ, không NETLOAD bản copy (bị khóa, làm hỏng lần build sau).

Kiểm tra

  • Giả lập VS (build plugin, chờ 2 giây, build Testing/Tests/Benchmarks với BuildProjectReferences=false): trước sửa CS0006, sau sửa qua.
  • MSBuild VS 18 sln Rebuild Debug|Any CPU, Debug|x64, DebugAcad|x64: qua (DebugAcad ra bin\x64\DebugAcad\net48\CadCoreFramework_<giờ>.dll + bản copy; build lần hai ra tên mới).
  • dotnet build -c Release -warnaserror (lệnh CI): 0 warning, 0 error.
  • dotnet test Debug: 376/376 trên net48 và net8.0-windows.
  • npm run check (docs): 0 lỗi.
  • Chưa kiểm: Ctrl+Shift+B trong VS GUI, và NETLOAD bản DebugAcad vào AutoCAD.

🤖 Generated with Claude Code

Building Debug|Any CPU in Visual Studio failed with CS0006 in
CadCoreFramework.Testing/Tests: the timestamped AssemblyName is
recomputed on every evaluation, and VS builds projects one by one,
so referencing projects looked for a DLL name that never existed.

- Debug now produces CadCoreFramework.dll (fixed name), like Release.
- New DebugAcad configuration keeps the hot-reload timestamp; in the
  .sln it builds only the plugin + analyzer (DebugAcad|x64).
- Docs (README, R01, R06, T01, T02, T04, T06, T09), deck, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Tmphi
Tmphi merged commit a525875 into main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants