-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android, 9.0 Preview 5] When run from command line (dotnet build), resizetizer still randomly fails with something being used by another process. #23495
Comments
@jonathanpeppers thoughts? |
Can you share a Are you by chance using any third-party antivirus software? Windows Defender should be ok. |
No, I just have the normal Windows anti-virus from Windows 11 Home, and even there the entire repo directory (C:\hmp) is defined as an excluded directory (in Windows Security app).
I'll see if I can provide something else later, too. |
And here's a binlog for one more type of frequent error (error CS0117: 'ResourceConstant.Drawable' does not contain a definition for 'notification_icon_background'): |
How are Do you have something like VS Code and Visual Studio (full) open at the same time? |
It is a good question why they are running at the same time. I think that is the root of many problems in the build process. I have Visual Studio open at the same time, since I use it as the editor for coding. I don't normally close it if I want to try building the app, which would be very inconvenient, since I like to build reasonably often. I run dotnet CLI from Tools > Command Line > Developer PowerShell, since Build in Visual Studio normally fails. It may be that also Visual Studio may run several MSBuilds for the exact same task, which is the reason the builds fail there. To me it looks like that dotnet.exe may call devenv.exe, which in turn starts MSBuild.exe for the exact same code as what dotnet.exe is running. |
So, if you close Visual Studio, does the problem with Likewise, if you build in Visual Studio (when |
The latter answer is that I do not run The former I need to investigate. It all is quite random, and it is difficult to tell when the problems do occur and when not. |
I can indeed confirm that when Visual Studio is closed only dotnet.exe runs (and succeeds), but if I open Visual Studio, it starts MSBuild.exe, possibly running the same tasks as dotnet.exe, leading to random build failures due to sharing violations. Here's a screenshot when devenv.exe is starting the MSBuild.exe from Process Monitor: All rows before that are just dotnet.exe and a few devenv.exe's. |
Here are the binlogs of the two builds, first with just dotnet.exe running and the second where also MSBuild started to run in parallel because Visual Studio was left open (both succeeded without incident): |
I don't think it's intended for two builds at the same time to be successful. You can't Am I misunderstanding somehow? Thanks. |
In both cases, I ran just |
When I run the build from Visual Studio, there are in fact two MSBuilds running that cause together a sharing violation, which makes the build fail: The Output window showed following:
|
I suspect that the extra MSBuild is the same duplicate process opened by Visual Studio in the same way it does for |
I made also an interesting exercise and opened 3 Visual Studio 17.11.0 Preview 3.0's (processes 14748, 39376, and 36388) before typing And third one here (process 18992): Later on, even a fourth MSBuild is started (process 8248): After closing all 3 Visual Studios and running the |
So, what is happening is:
I think this issue might be best suited for VS Help > Send Feedback, as it seems like something Visual Studio or the project system team could comment on. I don't think it is something we can fix here. |
I just sent them something on this. I'll add your comments to it. But I would think somebody inside Microsoft should be able to coordinate this between teams already on this issue basis, but perhaps that's not how things work over there. In any case, perhaps that would be an improvement idea for the feedback channels. It seems a bit cumbersome for everybody that one needs to post support tickets to multiple places. |
@jfversluis I would like to add that this also explains #21542 and #21838 and possibly many other issues. I couldn't comment on the other issues since they are locked, but I think it would be good to prioritize fixing this issue on the Visual Studio side, as this impacts everyone using .NET MAUI with Visual Studio. |
@dellis1972 @mattleibow This is probably at least partly the cause of several similar issues where a file is not being found or a file is being used by another process. |
@jonathanpeppers For |
Thanks for the issue report @janne-hmp! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS. If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
|
Thanks for the issue report @janne-hmp! This issue appears to be a problem with Visual Studio (Code), so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS (Code). If you encounter a problem with Visual Studio or the .NET MAUI VS Code Extension, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
|
Description
In Visual Studio, almost all builds fail for Android when all platforms are built at the same time. CLI (dotnet build) works better, but looks like even it can sometimes fail. The file that is used by another process seems to vary.
Steps to Reproduce
Try to build GnollHackM for Android enough times using
dotnet build
command. Maybe 1 out of 20 builds fails like this. In Visual Studio 2022 17.11.0 Preview 2.1, when building all platforms at the same time, at least every other build fails.Link to public reproduction project repository
https://github.com/hyvanmielenpelit/GnollHack
Version with bug
9.0.0-preview.4.10690
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
Build the app again. But this happening in Visual Studio all the time, especially when building all platforms at the same time, and now even with dotnet CLI.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: