From b8c1406a87663b97e4624873aba0944381c25256 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 4 Mar 2026 12:14:15 +0100 Subject: [PATCH] [msbuild] Fix race condition when generating MSBStrings.Designer.cs When the Xamarin.Localization.MSBuild project was changed to multi-target (netstandard2.0 + net10.0), both inner builds run in parallel and both try to generate MSBStrings.Designer.cs to the same path. One build may write the file while the other is compiling it, causing: CSC : error CS1504: Source file 'MSBStrings.Designer.cs' could not be opened -- Attempted to read past the end of the stream. Fix by directing StronglyTypedFileName to $(IntermediateOutputPath), which is per-TFM (obj/Debug/netstandard2.0/ vs obj/Debug/net10.0/), so each inner build generates its own copy without interfering with the other. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Xamarin.Localization.MSBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj b/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj index dc64d52af0f8..ff948e805810 100644 --- a/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj +++ b/msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj @@ -18,7 +18,7 @@ Resx PublicResXFileCodeGenerator MSBStrings.Designer.cs - MSBStrings.Designer.cs + $(IntermediateOutputPath)MSBStrings.Designer.cs CSharp Xamarin.Localization.MSBuild MSBStrings