You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you get errors about .pdb files such as:
Errors
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.102/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3027: Could not copy "obj/Release/net7.0-maccatalyst/Microsoft.Maui.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.pdb". Exceeded retry count of 10. Failed. [/Users/builder/azdo/_work/2/s/src/Core/src/Core.csproj]
/Users/builder/azdo/_work/2/s/bin/dotnet/sdk/7.0.102/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3021: Unable to copy file "obj/Release/net7.0-maccatalyst/Microsoft.Maui.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.pdb". The process cannot access the file '/Users/builder/azdo/_work/2/s/src/Core/src/bin/Release/net7.0-maccatalyst/Microsoft.Maui.pdb' because it is being used by another process. [/Users/builder/azdo/_work/2/s/src/Core/src/Core.csproj]
I think this occurs if you have multiple MacCatalyst app projects in a solution and build them. I think it might have been introduced when RuntimeIdentifiers=maccatalyst-x64;maccatalyst-arm64 became the default? But also might be combination of some change in the .NET SDK or MSBuild.
/Users/builder/azdo/_work/1/s/bin/dotnet/sdk/7.0.103/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3027: Could not copy "obj/Release/net7.0-maccatalyst/Microsoft.Maui.Controls.Compatibility.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.Controls.Compatibility.pdb". Exceeded retry count of 10. Failed. [/Users/builder/azdo/_work/1/s/src/Compatibility/Core/src/Compatibility.csproj::TargetFramework=net7.0-maccatalyst]
/Users/builder/azdo/_work/1/s/bin/dotnet/sdk/7.0.103/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3021: Unable to copy file "obj/Release/net7.0-maccatalyst/Microsoft.Maui.Controls.Compatibility.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.Controls.Compatibility.pdb". The process cannot access the file '/Users/builder/azdo/_work/1/s/src/Compatibility/Core/src/bin/Release/net7.0-maccatalyst/Microsoft.Maui.Controls.Compatibility.pdb' because it is being used by another process. [/Users/builder/azdo/_work/1/s/src/Compatibility/Core/src/Compatibility.csproj::TargetFramework=net7.0-maccatalyst]
/Users/builder/azdo/_work/1/s/bin/dotnet/sdk/7.0.103/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3027: Could not copy "obj/Release/net7.0-maccatalyst/Microsoft.Maui.Essentials.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.Essentials.pdb". Exceeded retry count of 10. Failed. [/Users/builder/azdo/_work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net7.0-maccatalyst]
/Users/builder/azdo/_work/1/s/bin/dotnet/sdk/7.0.103/Microsoft.Common.CurrentVersion.targets(4752,5): error MSB3021: Unable to copy file "obj/Release/net7.0-maccatalyst/Microsoft.Maui.Essentials.pdb" to "bin/Release/net7.0-maccatalyst/Microsoft.Maui.Essentials.pdb". The process cannot access the file '/Users/builder/azdo/_work/1/s/src/Essentials/src/bin/Release/net7.0-maccatalyst/Microsoft.Maui.Essentials.pdb' because it is being used by another process. [/Users/builder/azdo/_work/1/s/src/Essentials/src/Essentials.csproj::TargetFramework=net7.0-maccatalyst]
Yeah, I tried to remove the RID in the csproj but it just failed with all the blazor things. I started a new PR for the total removal as that PR is just to make it work today.
I'm seeing a now relatively frequent build collision on CI for DLLs in a large-ish MAUI project. Seems like it tries to build dependencies twice for catalyst release (maccatalyst-x64 and maccatalyst-arm64) with the same path (libraries don't have the runtime identifier included in the OutputPath and AppendRuntimeIdentifierToOutputPath only seems to apply to RuntimeIdentifier and not RuntimeIdentifiers). In Visual Studio the collision doesn't seem to occur though (and I can see that it only tries to build the catalyst DLLs once there).
00:04:56.961 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: The "XamlCTask" task failed unexpectedly. [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.961 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: System.IO.IOException: The process cannot access the file 'C:\src\project\Controls.Maui\obj\Release\net8.0-maccatalyst\Controls.Maui.dll' because it is being used by another process. [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.961 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.961 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) in C:\src\cecil\Mono.Cecil\ModuleDefinition.cs:line 1098 [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at Microsoft.Maui.Controls.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions) in /_/src/Controls/src/Build.Tasks/XamlCTask.cs:line 156 [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at Microsoft.Maui.Controls.Build.Tasks.XamlTask.Execute() in /_/src/Controls/src/Build.Tasks/XamlTask.cs:line 38 [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
00:04:56.962 C:\Users\ContainerUser\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.80\buildTransitive\netstandard2.0\Microsoft.Maui.Controls.targets(158,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\src\project\Controls.Maui\Controls.Maui.csproj::TargetFramework=net8.0-maccatalyst]
@rolfbjarne Thanks for getting back to me so quickly! I was curious why I was getting different results on CI. Seems like it was failing with VS BuildTools 17.10.6 LTSC (with MSBuild 17.10.4), but it works locally with 17.11.0. Updating the CI environment resolves the problem. I could share the binlog with you if there's perhaps something that needs backporting to LTSC, but seems that whatever the problem is already fixed upstream - I can just use the current channel.
@rolfbjarne Thanks for getting back to me so quickly! I was curious why I was getting different results on CI. Seems like it was failing with VS BuildTools 17.10.6 LTSC (with MSBuild 17.10.4), but it works locally with 17.11.0. Updating the CI environment resolves the problem. I could share the binlog with you if there's perhaps something that needs backporting to LTSC, but seems that whatever the problem is already fixed upstream - I can just use the current channel.
That's weird... I'm not aware of any fixes in this area. Parallel issues can be annoying to track down though, some completely different thing might cause the build to happen in a different order, thus avoiding the problem.
If you have a binlog already that shows the error, I'd love to see it, otherwise don't worry about it.
@rolfbjarne Yeah, it's hard to be sure whether it truly resolves the problem yet. I was wrong about it colliding between arm64 and x64 - the error can also still occur on 17.10 if I only build maccatalyst-x64, and I can see the collision in the structured log viewer. It was occuring on most runs on 17.10 but I've yet to repro the issue on 17.11 after a few dozen runs now. I'm happy to share the binlogs with you - maybe I'd just done something wrong/silly, but is there a way I can provide it to you privately?
Activity
[build] use stable bits in main (#13201)
rolfbjarne commentedon Feb 10, 2023
Is it always
Microsoft.Maui.pdb, or does it happen with pdbs from other assemblies as well?It's also interesting to note that the source file and the destination file are identical, so it's trying to copy a file over itself.
jonathanpeppers commentedon Feb 10, 2023
I think I saw it do
Microsoft.Maui.Maps.pdbonce. I don't think I was able to reproduce it locally, though...jonathanpeppers commentedon Feb 11, 2023
@rolfbjarne here is another example:
https://dev.azure.com/xamarin/public/_build/results?buildId=79089&view=logs&jobId=fa417ba0-7221-55e8-0ddb-67022373081a&j=fa417ba0-7221-55e8-0ddb-67022373081a&t=28a777bb-b552-5226-8cc7-96e0eb4324c7
You want this
.binlog:Merge net8.0 into release/8.0.1xx-preview1 (#13441)
[build] use stable bits in main (dotnet#13201)
[build] use stable bits in main (#13201)
rolfbjarne commentedon Aug 15, 2023
@jonathanpeppers have you seen this recently?
jonathanpeppers commentedon Aug 15, 2023
I think if they can merge this, it would be 100% fixed: dotnet/maui#16678
@mattleibow is there something still wrong with a MAUI+Blazor app?
mattleibow commentedon Aug 15, 2023
Yeah, I tried to remove the RID in the csproj but it just failed with all the blazor things. I started a new PR for the total removal as that PR is just to make it work today.
This PR is the remove all explicit rids: dotnet/maui#16765
jeremy-visionaid commentedon Aug 20, 2024
I'm seeing a now relatively frequent build collision on CI for DLLs in a large-ish MAUI project. Seems like it tries to build dependencies twice for catalyst release (maccatalyst-x64 and maccatalyst-arm64) with the same path (libraries don't have the runtime identifier included in the
OutputPathandAppendRuntimeIdentifierToOutputPathonly seems to apply toRuntimeIdentifierand notRuntimeIdentifiers). In Visual Studio the collision doesn't seem to occur though (and I can see that it only tries to build the catalyst DLLs once there).rolfbjarne commentedon Aug 20, 2024
We build multiple RuntimeIdentifiers using the MSBuild task:
https://github.com/xamarin/xamarin-macios/blob/bb965c1724ef510d818171186f5085ef87b3f71c/dotnet/targets/Xamarin.Shared.Sdk.targets#L390-L402
and the MSBuild task is by default not parallel: "BuildInParallel=If true, the projects specified in the Projects parameter are built in parallel if it is possible. Default is false." (https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-task?view=vs-2022)
So it's somewhat of a mystery how this happens.
@jeremy-visionaid do you have an MSBuild binlog for a build that fails?
jeremy-visionaid commentedon Aug 20, 2024
@rolfbjarne Thanks for getting back to me so quickly! I was curious why I was getting different results on CI. Seems like it was failing with VS BuildTools 17.10.6 LTSC (with MSBuild 17.10.4), but it works locally with 17.11.0. Updating the CI environment resolves the problem. I could share the binlog with you if there's perhaps something that needs backporting to LTSC, but seems that whatever the problem is already fixed upstream - I can just use the current channel.
rolfbjarne commentedon Aug 20, 2024
That's weird... I'm not aware of any fixes in this area. Parallel issues can be annoying to track down though, some completely different thing might cause the build to happen in a different order, thus avoiding the problem.
If you have a binlog already that shows the error, I'd love to see it, otherwise don't worry about it.
jeremy-visionaid commentedon Aug 20, 2024
@rolfbjarne Yeah, it's hard to be sure whether it truly resolves the problem yet. I was wrong about it colliding between arm64 and x64 - the error can also still occur on 17.10 if I only build
maccatalyst-x64, and I can see the collision in the structured log viewer. It was occuring on most runs on 17.10 but I've yet to repro the issue on 17.11 after a few dozen runs now. I'm happy to share the binlogs with you - maybe I'd just done something wrong/silly, but is there a way I can provide it to you privately?rolfbjarne commentedon Aug 21, 2024
@jeremy-visionaid if you can put them on Dropbox or a similar service, and then send the link to my email (Rolf.Kvinge@microsoft.com) that would be great.
rolfbjarne commentedon Sep 12, 2024
With help from @jeremy-visionaid, I was able to determine that this was fixed with #19990.