Skip to content
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

UnauthorizedAccessExceptions are getting raised when building a blank MAUI app when using .NET 9.0 #9133

Closed
whodges opened this issue Jul 10, 2024 · 80 comments · Fixed by #9409 or #9531
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. regression

Comments

@whodges
Copy link

whodges commented Jul 10, 2024

Description

I just moved to MAUI 9 this morning (specifically 9.0.0-preview.6.24327.7). I was using .NET 8.0 prior to this and everything was fine. I noticed that the first build of solution would work fine, but if I did a rebuild all, the build would fail with an UnauthorizedAccessException. The only way I can get it to go away is to close and reopen VS (I'm using 17.11.0 Preview 3.0, for the record, running in admin mode on Win 10). After that, it builds again, but only once before I start getting the UnauthorizedAccessExceptions.

To investigate, I made a blank .NET MAUI 8 app and tried it - everything builds fine. You can 'Rebuild All' as many times as you want and it'll compete successfully.

Then I made a blank .NET MAUI 9 app and built it - it was fine the first time. Then I tried 'Rebuild All' and, unfortunately, ran into the same UnauthorizedAccessExceptions during the build:

Error (active)	XARDF7019	System.UnauthorizedAccessException: Access to the path 'GoogleGson.dll' is denied.
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at Xamarin.Android.Tasks.RemoveDirFixed.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/RemoveDirFixed.cs:line 54	MauiApp2 (net9.0-android)	C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.99.0-preview.6.340\tools\Xamarin.Android.Common.targets	2503

and

Error (active)	XALNS7019	System.UnauthorizedAccessException: Access to the path 'D:\Projects\MauiApp2\obj\Debug\net9.0-android\android\assets\armeabi-v7a\MauiApp2.dll' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at Microsoft.Android.Build.Tasks.Files.CopyIfChanged(String source, String destination) in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 125
   at Xamarin.Android.Tasks.MonoAndroidHelper.CopyAssemblyAndSymbols(String source, String destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs:line 344
   at Xamarin.Android.Tasks.LinkAssembliesNoShrink.CopyIfChanged(ITaskItem source, ITaskItem destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 161
   at Xamarin.Android.Tasks.LinkAssembliesNoShrink.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 76
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25	MauiApp2 (net9.0-android)	C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.99.0-preview.6.340\tools\Xamarin.Android.Common.targets	1407

These all seem to be Android-releated. And when I try to deploy the successful build to my Android device, I get this error:

Error		XA0127: Error deploying 'files/.__override__/arm64-v8a/ar//Microsoft.Maui.Controls.resources.dll' using 'xamarin.sync: error: could not open 'files/.__override__/arm64-v8a/ar//Microsoft.Maui.Controls.resources.dll'.'.
Please set the 'EmbedAssembliesIntoApk' MSBuild property to 'true' to disable Fast Deployment in the Visual Studio project property pages, or edit the project file in a text editor.

I never got this error with .NET 8.0. Again, this is a fresh MAUI 9.0 app.

Steps to Reproduce

  1. Create a new, default .NET MAUI 9.0 app (use 9.0.0-preview.6.24327.7).
  2. Rebuild it. It should succeed.
  3. Rebuild it again. It should fail with an UnauthorizedAccessException.

Link to public reproduction project repository

https://github.com/whodges/mauiapp1

Version with bug

9.0.0-preview.1.9973

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.70

Affected platforms

Android

Affected platform versions

Android 31

Did you find any workaround?

Close and restart Visual Studio (but you'll only get one build out of it).

Relevant log output

binlog_success.zip
binlog_fail.zip
binlog_deploy_fail.zip

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@whodges
Copy link
Author

whodges commented Jul 10, 2024

I dug in a bit more, trying different versions. Everything builds fine with 8.0.70, and then this rebuild issue appears with 9.0.0-preview.1.9973.

@PureWeen
Copy link
Member

Can you create and attach a binlog please?
https://github.com/dotnet/maui/wiki/Capturing-Binary-Logs

@jonathanpeppers ?

@whodges
Copy link
Author

whodges commented Jul 11, 2024

Yep, np. I editted in two attached two binlogs: binlog_success is from the first rebuild, and binlog_fail is from the subsequent rebuilds.

EDIT: Added a third one, which is when I try and deploy the second build. It's the same UnauthorizedAccessException error, but involving different files.

@ninachen03
Copy link

This issue has been verified using Visual Studio 17.11.0 Preview 3 (9.0.0-preview.1.9973 & 9.0.0-preview.6.24327.7). Cannot repro it.
I followed the steps to reproduce, but the problem did not reoccur on both machines (17.11.0 Preview 3+Net 9 preview 5, 17.11.0 Preview 3 +NET9 preview 6). Are there any other special steps? If so, please let me know.

@whodges
Copy link
Author

whodges commented Jul 11, 2024

Ok - I just tried it on a completely different computer that I installed the latest .NET 9 SDK on, along with the latest preview version of VS 2022 (9.0.0-preview.6.24327.7 and 17.11.0 Preview 3.0, respectively), and I got the exact same UnauthorizedAccessException involving 'GoogleGson.dll'.

I just made a github of the .NET 9.0 MAUI app itself, but again, it's just the default app that VS creates for you: https://github.com/whodges/mauiapp1.git. Not sure if that helps.

I'm 100% open to doing anything that would shed more light on this for you all. I was going to chalk this up to something involving my environment, but reproducing it on a separate machine concerns me. I totally get though that this is something that would've been noticed early on your end, so why I seem to be the only one experiencing it is definitely odd.

EDIT: Here's the binlog from the other machine:

binlog.zip

EDIT2: A screenshot just because:

exception

EDIT3: And again, if I switch to .NET 8 (MAUI 8.0.70), everything is fine.

@whodges
Copy link
Author

whodges commented Jul 17, 2024

Just tried again with 17.11.0 Preview 4.0. Same issue: the first build works, then 'Rebuild Solution' results in Access to the path 'GoogleGson.dll' is denied. Following it with 'Build Solution' results in Access to the path 'D:\Projects\MauiApp1\obj\Debug\net9.0-android\android\assets\armeabi-v7a\MauiApp1.dll is denied.

Note that this only happens with Debug builds. Everything is fine with Release.

@thomasmiko
Copy link

I get the same error in a MAUI Project with .NET9 and with Visual Studio 17.11 Preview 2.1. With NET8 everything works without problems

@PureWeen PureWeen transferred this issue from dotnet/maui Jul 23, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Jul 23, 2024
@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. regression and removed needs-triage Issues that need to be assigned. labels Jul 29, 2024
@jpobst jpobst added this to the .NET 9 milestone Jul 29, 2024
@jonathanpeppers
Copy link
Member

The last error:

Error		XA0127: Error deploying 'files/.__override__/arm64-v8a/ar//Microsoft.Maui.Controls.resources.dll' using 'xamarin.sync: error: could not open 'files/.__override__/arm64-v8a/ar//Microsoft.Maui.Controls.resources.dll'.'.
Please set the 'EmbedAssembliesIntoApk' MSBuild property to 'true' to disable Fast Deployment in the Visual Studio project property pages, or edit the project file in a text editor.

Should be fixed in:

Which should hopefully be in .NET 9 Preview 7.

@jonathanpeppers
Copy link
Member

I tried with the .NET 9 Preview 7 build we are working on, I can't seem to reproduce the UnauthorizedAccessException even with 4 Rebuilds:

image

If you are having this issue, can you use a tool like ProcessExplorer to find out what process is locking the file:

System.UnauthorizedAccessException: Access to the path 'GoogleGson.dll' is denied.

@whodges
Copy link
Author

whodges commented Aug 7, 2024

I tried both procexp and tasklist; unfortunately neither reports that any program currently has the file in use. I dug in a bit more though and found that every file in obj\Debug\net9.0-android\android\assets\armeabi-v7a is locked (that is, if you try and delete it via Explorer, you'll get a "the file is open in another program" error, though any unlocking utility will report the file as being unlocked). That program is obvious either VS or related to VS, as closing VS unlocks that directory and its files (and a Rebuild will then work - but just once because then obj\Debug\net9.0-android\android\assets\armeabi-v7a gets locked again).

EDIT: I tried this using 17.11.0 Preview 7.0.

@dellis1972
Copy link
Contributor

@whodges

Do you have any third party Visual Studio extensions installed (just trying to eliminate causes) for things like code formatting or intellisense.
What kind of Anti Virus do you have installed?
Do you use hot reload?

Those files are clearly being locked by VS but its odd that it does not show up in the procexp 🤔

@whodges
Copy link
Author

whodges commented Aug 7, 2024

The only non-MS extensions I have are Multiline Search and Replace (Helixsoft) and Xamarin.Android SDK. AV is just MS Defender. But on the other Win 10 system I tried this on, there's no AV and no extensions installed. Yes I have Hot Reload active on both, but just tried disabling it to no avail; the same error occurs.

@jonathanpeppers
Copy link
Member

I tested this on a DevBox/Virtual Machine, and I noticed the project by default is saved on a Dev Drive.

Let me just check if anything different happens on a regular drive where Windows Defender will do its standard scanning on file writes.

@whodges does anything different happen if you have a Windows Defender exclusion for the folder where the project is saved?

@whodges
Copy link
Author

whodges commented Aug 7, 2024

Just tried the exclusion; no luck

@whodges
Copy link
Author

whodges commented Aug 27, 2024

Still occurs on version 17.12.0 Preview 1.0

@foximoxi
Copy link

foximoxi commented Sep 2, 2024

I've got similar issue.

17.12.0 Preview 1.0/.NET9 Preview 7 -> New MAUI project -> Build:

Output:
System.UnauthorizedAccessException: Access to the path is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Microsoft.Android.Build.Tasks.Files.CopyIfChanged(String source, String destination) in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 125
at Xamarin.Android.Tasks.MonoAndroidHelper.CopyAssemblyAndSymbols(String source, String destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs:line 344
at Xamarin.Android.Tasks.LinkAssembliesNoShrink.CopyIfChanged(ITaskItem source, ITaskItem destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 161
at Xamarin.Android.Tasks.LinkAssembliesNoShrink.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 76
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

It works when I start VS as Administrator. But after a few builds and run it appears again.
So it looks like file handler is not closed/some process is still running.

@whodges
Copy link
Author

whodges commented Sep 2, 2024

Interesting - it happens for me running VS as admin no matter what after the first build.

I also wonder if it could be some regional settings for whatever weird reason? I’m in Canada.

@jonathanpeppers
Copy link
Member

This will help diagnose these types of issues:

But it looks like I should add UnauthorizedAccessException, which is perhaps thrown by File.Delete()?

jonathanpeppers added a commit to jonathanpeppers/xamarin-android-tools that referenced this issue Sep 6, 2024
…zedAccessException

Context: dotnet/android#9133

In the above issue, a customer got:

    error XARDF7019: System.UnauthorizedAccessException: Access to the path 'GoogleGson.dll' is denied.
    at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
    at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
    at Xamarin.Android.Tasks.RemoveDirFixed.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/RemoveDirFixed.cs:line 54	MauiApp2 (net9.0-android)	C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.99.0-preview.6.340\tools\Xamarin.Android.Common.targets

Let's expand upon 11fad9d to include `UnauthorizedAccessException`.

Unfortunately, I wasn't able to *reproduce* this exception, I tried
several things:

* `File.Delete` on a file

* `File.Delete` on the currently running test assembly

* `File.SetAttributes` to `ReadOnly` on a file

* `Directory.Delete` on a directory with readonly files

I settled on just throwing `UnauthorizedAccessException` with the
exact same message reported in dotnet/android#9133. It may or may not
work, depending on if the message has a valid path to the file.

This still seems useful though -- better than nothing.
@pjeremic
Copy link

pjeremic commented Sep 11, 2024

Hi!
In my situation, MsBuild.exe holds onto .dll files. If I kill that specific MsBuild instance (identified using Process Explorer), I can build the app again.
Additionally, I’ve noticed that if I wait for a minute or so, the process eventually releases the .dll files, allowing me to build once more.
While there’s no specific reproducible scenario, I’ve observed that certain workflows trigger this issue with locked app .dll files (it's not always the app dll, for example once it was the CommunityToolkit.Mvvm.dll):

Case 1:

  1. Build the app.
  2. Run it.
  3. Close the app in the emulator.
  4. Make a small code change to ensure that the app needs recompilation.
  5. Attempt to build and deploy.

Case 2:

  1. The app is running in the emulator.
  2. Make a small code change to ensure that the app needs recompilation.
  3. Press hot reload.
  4. Stop the app.
  5. Attempt to build and deploy.

Case 3:

  1. The app is running in the emulator.
  2. Press the restart button (Ctrl+Shift+F5).
  3. Stop the app.
  4. Make a small code change to ensure that the app needs recompilation.
  5. Attempt to build and deploy.

Important Note: I’ve tried the mentioned scenarios with a blank/sample app using .NET 8.0 LTS, and it works perfectly. Additionally, deployment to the emulator also seems faster.

TargetFrameworks: net9.0-android;net9.0-ios;net9.0-maccatalyst
VS: 17.12.0 Preview 1.0
Emulator: Pixel 5- API 34 (Android 14.0 - API 34)
dotnet --version : 9.0.100-preview.7.24407.12

Exception:

System.UnauthorizedAccessException: Access to the path '<MY PATH :)>\repos\MauiApp2\MauiApp2\obj\Debug\net9.0-android\android\assets\armeabi-v7a\MauiApp2.dll' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Microsoft.Android.Build.Tasks.Files.CopyIfChanged(String source, String destination) in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 125
at Xamarin.Android.Tasks.MonoAndroidHelper.CopyAssemblyAndSymbols(String source, String destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs:line 344
at Xamarin.Android.Tasks.LinkAssembliesNoShrink.CopyIfChanged(ITaskItem source, ITaskItem destination) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 161
at Xamarin.Android.Tasks.LinkAssembliesNoShrink.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs:line 76
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

jonathanpeppers added a commit that referenced this issue Nov 21, 2024
Fixes: #9133

Context: https://discord.com/channels/732297728826277939/732297916680765551/1308554103206580244
Context: 86260ed

Various customers have been reporting `UnauthorizedAccessExceptions`
in incremental builds, which seems to be a new problem in .NET 9.
We were not able to reproduce the issue locally, but with the number
of reports it seems to be a real issue.

One customer shared a [`MSBuild.dmp`][0] file (while the file was
locked), where I could observe the objects in memory:

	MemoryMappedViewStream	132
	    Mono.Cecil.PE.Image	100
	        Mono.Cecil.ModuleDefinition	100
	            Mono.Cecil.TypeDefinition	100
	                Mono.Cecil.TypeDefinition[]	100
	                    List<Mono.Cecil.TypeDefinition>	1
	                        Xamarin.Android.Tasks.NativeCodeGenState [Static variable Xamarin.Android.Tasks.NativeCodeGenState.<Template>k__BackingField]	1

Then realized the problem was:

  * We opened some `.dll` files with `Mono.Cecil`.

  * They were never closed.

  * Future incremental build attempts would fail on various
    operations of the same `.dll` files.

We were also storing some static state (`NativeCodeGenState`) to be
shared across multiple MSBuild tasks:

	partial class NativeCodeGenState {
	    public static NativeCodeGenState? Template { get; set; }
	}

`NativeCodeGenState` also holds a `XAAssemblyResolver` in a `Resolver`
property.  This means this `XAAssemblyResolver` instance would *also*
be kept alive.

It appears we only use the static `Template` property for a `bool`
flag, so I changed the property to a `bool` instead:

	partial class NativeCodeGenState {
	    public static bool TemplateJniAddNativeMethodRegistrationAttributePresent { get; set; }
	}

After this change, we can safely dispose `Resolver` instances.
I looped over the `NativeCodeGenState` instances disposing of each
`Resolver` at the end of the `<GenerateJavaStubs/>` and
`<GeneratePackageManagerJava/>` MSBuild tasks.

[0]: https://drive.google.com/file/d/12dOkO6ZdbK67sNeY_PVS4d0mgnLyOwUA/view?pli=1
avans-marc added a commit to avans-marc/RandomFactApp that referenced this issue Nov 26, 2024
avans-marc added a commit to avans-marc/RandomFactApp that referenced this issue Nov 26, 2024
* Initial commit with readme

* Added alternative implementation to demonstrate the advantage of DI.

* Added Union Architecture  & Unit Tests (#1)

* Setup Unit Tests and create separate physical libraries to make it more testable.

* WIP - testing

* Union + Unit Testing Finish

* Example of MVVM binding to a Map Control

* Example of MVVM binding to a Map Control

* Removed secret

* Removed secret

* Removed secret

* Bump back to version 8 because of dotnet/android/issues/9133
@amryakout2024
Copy link

amryakout2024 commented Nov 28, 2024

i got the same issue with .net9
need to restart and rebuild the project to bypass this error
then appears again and again

System.UnauthorizedAccessException: Access to the path 'CommunityToolkit.Maui.Core.dll' is denied.
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Xamarin.Android.Tasks.RemoveDirFixed.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/RemoveDirFixed.cs:line 86

@Barry-Theunissen
Copy link

@amryakout2024 Yes...it is still an issue...but I think it has been fixed...we need to wait for the patch release to .NET 9 I think...not sure when that will be though

@OvrBtn
Copy link

OvrBtn commented Nov 28, 2024

need to restart and rebuild the project to bypass this error

@amryakout2024 you can kill the blocking process, it will definitely be faster than rebuilding whole project

@Michealdgreat
Copy link

I am also having the same issue. So annoying that I have to restart VS every time to have a successful build. Version 17.12.2

@maverikou
Copy link

I am also having the same issue. So annoying that I have to restart VS every time to have a successful build. Version 17.12.2

You don't.

Run taskkill /IM "msbuild.exe" /F instead.

@Michealdgreat
Copy link

Michealdgreat commented Nov 28, 2024

I am also having the same issue. So annoying that I have to restart VS every time to have a successful build. Version 17.12.2

You don't.

Run taskkill /IM "msbuild.exe" /F instead.

I am dev-tunneling an Api locally on the same machine, so running this would also kill the msbuild for the api as well. We need an actual fix not a work around.

@OvrBtn
Copy link

OvrBtn commented Nov 28, 2024

I am also having the same issue. So annoying that I have to restart VS every time to have a successful build. Version 17.12.2

You don't.
Run taskkill /IM "msbuild.exe" /F instead.

I am dev-tunneling an Api locally on the same machine, so running this would also kill the msbuild for the api as well. We need an actual fix not a work around.

The issue is already fixed and all we are waiting for is the next release.

As for other workaround did you try just killing the process that is blocking the file instead of killing all MSBuild.exe processes?
Alternatively can you use .NET 8 for development and .NET 9 just for the release builds?

@Michealdgreat
Copy link

I am also having the same issue. So annoying that I have to restart VS every time to have a successful build. Version 17.12.2

You don't.
Run taskkill /IM "msbuild.exe" /F instead.

I am dev-tunneling an Api locally on the same machine, so running this would also kill the msbuild for the api as well. We need an actual fix not a work around.

The issue is already fixed and all we are waiting for is the next release.

As for other workaround did you try just killing the process that is blocking the file instead of killing all MSBuild.exe processes? Alternatively can you use .NET 8 for development and .NET 9 just for the release builds?

Good to hear that it's been fixed.

I tried killing the msbuild for the MAUI, it works sometimes, but most of the times it doesn't work.

I didn't kill all of msbuild as the other one is for the API powering the application.

@SantosVictorero
Copy link

The issue is already fixed and all we are waiting for is the next release.

Great, glad to hear that! 👍

@snydesc
Copy link

snydesc commented Dec 5, 2024

I just updated to visual studio 17.12.3 which was released today and the problem still happens.

running taskkill /IM "msbuild.exe" /F does not solve the problem

@Barry-Theunissen
Copy link

Yes, the problem is still not solved - I am seeing the same thing with 17.12.3

@dellis1972
Copy link
Contributor

There were a couple of fixes in this area. The commit be53aed might well have been related. And GitHub Auto closed this Issue when that PR was merged.

That said is it more accurate that PR #9531 fixes this issue. This has been cherry-picked to the .net 9 release branch via 974a5ab. I'm not sure when that is being released though. @jonpryor any ideas when that commit will actually make it into a release?

If anyone is seeing this on the 17.12.3 please get us binlogs of the issue (with the error in it) as it will give us some pointers as to what is going on .

@dellis1972 dellis1972 reopened this Dec 6, 2024
@dellis1972
Copy link
Contributor

It looks like the "fix" was released in .NET Android SDK 35.0.24.
You can check to see which version you have in "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows" You should have a 35.0.24 folder if that has been released.

@dellis1972
Copy link
Contributor

I ran the 17.12.3 update on a VM and I can confirm that the .NET Android 35.0.24 update is not present. I also ran dotnet workload update to make sure. Looks like the fix has not yet been released.
I will leave this issue open until 35.0.24 actually gets released.

@jonathanpeppers
Copy link
Member

The fix is inserted in the next VS 17.13 Preview, but we will also ship it to NuGet.org.

@wjsimon
Copy link

wjsimon commented Dec 6, 2024

The fix is inserted in the next VS 17.13 Preview, but we will also ship it to NuGet.org.

Are binlogs from the error on 17.12.3 still of interest then? I could provide if yes.

@FM1973
Copy link

FM1973 commented Dec 6, 2024

The fix is inserted in the next VS 17.13 Preview, but we will also ship it to NuGet.org.

Yes, please. When can we expect the next update? This problem is really annoying and a blocker for a normal workflow.

@jonathanpeppers
Copy link
Member

Are binlogs from the error on 17.12.3 still of interest then? I could provide if yes.

There are no Android changes in this release, so I wouldn't expect anything to change. dotnet workload list will show the version of the Android workload, which you need to have 35.0.24 or higher.

@jonathanpeppers
Copy link
Member

This released today:

So, you can install either VS 17.13 Preview 2, or run dotnet workload update to get the latest Android workload. Thanks!

@OvrBtn
Copy link

OvrBtn commented Dec 10, 2024

Can't reproduce the issue on 35.0.24 anymore!
Thank you for fixing it :))

@whodges
Copy link
Author

whodges commented Dec 10, 2024

Just tried it and it works for me! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. regression
Projects
None yet