docs: add MSB3103 troubleshooting - #84287
mwiemer-microsoft with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Still relevant as dotnet/arcade#17061 hasn't been closed yet. |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are documentation-only, and remaining feedback is limited to non-blocking cleanup warnings.
Pull request overview
Adds Windows and Unix/macOS troubleshooting guidance for MSB3103 errors caused by stale XliffTasks caches after moving a repository.
Changes:
- Documents diagnosis and targeted cache cleanup.
- Adds platform-specific recovery commands.
- References the upstream XliffTasks fix.
File summaries
| File | Summary |
|---|---|
docs/contributing/Building, Debugging, and Testing on Windows.md |
Adds Windows troubleshooting guidance. |
docs/contributing/Building, Debugging, and Testing on Unix.md |
Adds Unix/macOS troubleshooting guidance. |
Review details
Suppressed comments (2)
docs/contributing/Building, Debugging, and Testing on Unix.md:146
git clean -xdfremoves every untracked and ignored file under the repository, not just.dotnetandartifacts; this can delete local repros, configuration, or other untracked work. Please explicitly warn users to back up untracked files and verify the dry-run output before running the destructive command.
- Or, the bigger hammer: `git clean -xdn` (dry run) then `git clean -xdf`. Note this also
deletes the locally-provisioned `.dotnet` SDK and the entire `artifacts/` tree, forcing a
full restore + rebuild, so prefer the targeted delete above.
docs/contributing/Building, Debugging, and Testing on Windows.md:275
git clean -xdfremoves every untracked and ignored file under the repository, not just.dotnetandartifacts; this can delete local repros, configuration, or other untracked work. Please explicitly warn users to back up untracked files and verify the dry-run output before running the destructive command.
- Or, the bigger hammer, `git clean -xdfn` (dry run) then `git clean -xdf`. Note this also
deletes the locally-provisioned `.dotnet` SDK and the entire `artifacts\` tree, forcing a
full restore + rebuild, so prefer the targeted delete above.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
| C:\Source> dotnet format analyzers .\roslyn\Compilers.slnf --diagnostics=RS0016 --no-restore --include-generated -v diag | ||
| ``` | ||
|
|
||
| ## Troubleshooting |
There was a problem hiding this comment.
we probably don't need two copies of this (it doesn't seem to be platform specific). Maybe keep the windows one and just link it here from unix.
There was a problem hiding this comment.
Done in 920da00 — the detailed section now lives only in the Windows doc, and the Unix doc links to it.
| where `<OLD-PATH>` is not the current location of your clone, the source `.resx` files are | ||
| fine. The failing files are generated localized resources under `artifacts\obj\...\*.xlf\`. | ||
|
|
||
| This happens because the [XliffTasks](https://github.com/dotnet/xliff-tasks) MSBuild tasks |
There was a problem hiding this comment.
I wonder if we need so much info here. Feels like we should make this a bit more generic. Like in general if you hit weird build issues, its a good idea to wipe the artifacts folder, and then if that doesn't work do a git clean. We can maybe mention this issue as a small example.
There was a problem hiding this comment.
Reworked in 920da00 — the section now leads with general advice (delete artifacts, then git clean -xdf if that doesn't help) and uses the MSB3103/rename case as a concrete example.
|
@copilot make the suggested changes |
Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
Applied both suggestions in 920da00: consolidated the troubleshooting section into the Windows doc only (Unix doc now links to it), and generalized the guidance to lead with wiping |
There was a problem hiding this comment.
🟡 Changes recommended
Add explicit Windows Remove-Item and Unix/macOS rm -rf cleanup commands.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
| See the [Troubleshooting section](Building,%20Debugging,%20and%20Testing%20on%20Windows.md#troubleshooting) | ||
| in the Windows doc, which is not Windows-specific (use `rm -rf` in place of `Remove-Item`). |
| timestamps and contents haven't changed. Deleting `artifacts\obj` (or just the affected | ||
| `.xlf` folders) as described above resolves it. This is being tracked upstream in | ||
| [dotnet/xliff-tasks](https://github.com/dotnet/xliff-tasks). |
Renaming or moving a Roslyn clone breaks subsequent builds with
MSB3103: Invalid Resx file … Could not find a part of the path '<OLD-PATH>\…'. The cause: XliffTasks bakes absoluteResXFileRefpaths into cached translated.resxfiles underartifacts/obj/. MSBuild's incremental build never retriggers on a rename (timestamps unchanged), so the stale absolute paths persist.Changes
docs/contributing/Building, Debugging, and Testing on Windows.md— new Troubleshooting section with diagnosis, targeted fix (Remove-Itemon the two stale.xlfcache dirs), the big-hammergit clean -xdfoption, and a pointer to the upstream xliff-tasks fixdocs/contributing/Building, Debugging, and Testing on Unix.md— same section adapted for Unix/macOS (rm -rf)Upstream fix (dotnet/xliff-tasks)
The root fix is to write
ResXFileRefpaths relative to the translated output directory rather than absolute, so cached artifacts survive a repo rename. The one-line change inTranslateSource.cs:RewriteRelativePathsRelativeTois a new virtual onTranslatableDocument(falls back to the old absolute behavior for other document types) with an override onResxDocumentthat usesPath.GetRelativePath(≥.NET 5) orUri.MakeRelativeUrion .NET Framework. The full patch with two regression tests is included in this PR description for the xliff-tasks maintainers to apply.