.Net 9 MAUI MVVM System.UnauthorizedAccessException Error
Hi,
After successfully running my .Net 9 MAUI MVVM application on Android Virtual Machine, when I made a major change in the code that Hot Reload does not support, sometimes when I take a short break and sometimes when I want to work on the project the following days, I get the following error. My development environment is Windows 10 Pro, VS 2022 version 17.12.4
In order to start working again, I need to do the following:
- Close All Tabs
- Close The Solution
- Delete bin and obj folders
- Open The Solution
- Clean Solution
- Rebuild Solution
ERROR MESSAGE:
CODE: XALNS7019
DESCRIPTION:
System.UnauthorizedAccessException: Access to the path 'A:\xyz\Documents\Visual Studio 2022\source\repos\TakvimDeneme2\TakvimDeneme2\obj\Debug\net9.0-android\android\assets\x86_64\TakvimDeneme2.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.CopyIfChangedOnce(String source, String destination) in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 197
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 176
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 394
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
FILE : Xamarin.Android.Common.targets
LINE : 1420