Ctrl+F5/F5 empties the rad.json of the project active when the publish finishes, not of the published project
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 40/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- devtools
调研方向
Start by tracing the publish completion flow in DebugAdapterLaunchBrowserRequestHandler and DebugAdapterLaunchRequestHandlerBase.PublishPackage, then compare it with BuildAndPublishHelper.EmptyRadContext(project). The issue identifies the wrong active project context as the cause; check the existing publish tests and add coverage for switching projects while a publish is running. Done means the published project's rad.json is emptied and the other project's file is unchanged.
由索引模型根据 Issue 内容生成。
描述
1. Describe the bug
In a multi-root workspace, Ctrl+F5 and F5 empty the rad.json of the project that's active when the publish finishes, instead of the project they published. If another project's file is focused by then (e.g. to publish that project next, as a large app takes minutes to publish), that project's rad.json is emptied, and the published project's rad.json keeps listing every object changed in it. AL: Publish full dependency tree for active project doesn't have the problem: it empties the rad.json of each project it published.
Running tests from VS Code is hit hardest. The Test Explorer builds every project reference whose rad.json lists changes, then publishes every project it built, whatever dependencyPublishingOption says. So the next test run republishes the app that was just published (minutes for a large app) before running the tests, even with "dependencyPublishingOption": "Ignore".
2. To Reproduce
- Multi-root workspace with app A, app B that depends on A, and test app T that depends on A. Every launch configuration has
"dependencyPublishingOption": "Ignore". - Change an object in A, so A's
.vscode/rad.jsonlists it. - Focus A's
app.jsonand press Ctrl+F5. - While A is publishing, focus B's
app.json. - Wait until A's publish succeeds.
- Open A's and B's
.vscode/rad.json. - Run any test of T from the Test Explorer.
3. Expected behavior
- Step 6: A's
rad.jsonis empty, as A was published. - Step 7: only T is built and published.
4. Actual behavior
- Step 6: B's
rad.jsonis emptied, and A's still lists the changed objects. - Step 7: the Test Explorer rebuilds A and publishes it again before T. Ctrl+F5 of B or T also rebuilds A, though with
Ignoreit only publishes B or T.
The cause, from the 18.1 binaries:
DebugAdapterLaunchRequestHandlerBase.PublishPackagetakes the project to publish fromLanguageServerOptions.ProjectRootwhen the publish starts.- Once the publish has succeeded,
DebugAdapterLaunchBrowserRequestHandlercallsEmptyThisAndPublishedPackagesRadFiles, which emptiesObjectChangeDocumentManager.ActiveObjectChangeManagerandVsCodeWorkspace.CurrentRadPath: the current project at that moment. BuildAndPublishHelper.PublishProjectsAsync(used by the full dependency publish and the Test Explorer) callsEmptyRadContext(project)for each project it published, which is right.RunTestRequestHandlercallsBuildAndPublishHelper.BuildAndPublishProjectsAsyncwithforceBuildOfAllDependenciesfalse, which publishes every project thatBuildWorkspaceAsyncbuilt (GetSortedProjectsForSelectivePublish), so a project reference with a stalerad.jsonis republished.
We hit this on 21 Oct 2026: A (about 800 objects, several minutes to publish) was published successfully (the app in the sandbox matches the local source, file for file), but afterwards its rad.json still listed all 9 objects changed in it, and B's had been emptied.
5. Versions:
- AL Language: 18.1.2842859
- Visual Studio Code: 1.142.0
- Business Central: 28.5 (online sandbox)
- List of Visual Studio Code extensions that you have installed: AL Language, plus others that don't take part in publishing (e.g. GitHub Copilot Chat, ALCops). The cause above is in the AL Language extension's own code.
- Operating System:
- Windows
- Linux
- MacOS
Final Checklist
- Search the issue repository to ensure you are reporting a new issue
- Reproduce the issue after disabling all extensions except the AL Language extension
- Simplify your code around the issue to better isolate the problem
- 主要语言
- PowerShell
- 星标
- 891
- 派生
- 287
- 平均合并
- 4 小时 7 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/AL 的其他 Issue
-
accepted al-tools bug
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 43/100
-
al_writetranslation: where should the .xlf land when targetLanguage is not a plain culture code?未关闭
难度 3/5 1-2 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 58/100
-
难度 4/5 3-5 天 新手友好度 55/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
bigbio/sdrf-pipelines#372 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Djangonauts
难度 2/5 1-3 小时 新手友好度 68/100
render-engine/render-engine-cli#71 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
davila7/claude-code-templates#1491 ·
维护者通常 1 天内回复
-
language P2 roadmap
难度 2/5 1-3 小时 新手友好度 78/100