Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Access denied to MyApp.android.pdb when archiving Xamarin Forms project #15365

Open
vsfeedback opened this issue May 10, 2022 · 4 comments
Open
Labels
feedback-ticket Issue originates from https://developercommunity.visualstudio.com s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
When trying to archive a Xamarin Forms app, the following exception is thrown:

The process cannot access the file 'D:\path\to\project\MyApp.Android\obj\Release\110\androidx\cecil\MyApp.Android.pdb' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.Cil.PortablePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName)
at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable1 stream, WriterParameters parameters) at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies)
at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute()
Done building project "MyApp.Android.csproj" -- FAILED.

I tried to find the process that uses "MyApp.Android.pdb", but Process Explorer shows that the only process with a handle to this file is devenv.exe. The handle gets closed about 30 seconds after the exception is thrown.

I tried to clean the solution (I also deleted bin and obj folders), I restarted my pc but nothing helped.

I attach full log for analysis.


Original Comments

Feedback Bot on 4/21/2022, 05:49 PM:

(private comment, text removed)

ROBERTO REALE on 4/27/2022, 02:38 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@jfversluis
Copy link
Member

Does it help if you move the project to a different folder maybe? And remove the .vs folder? Not sure what might trigger this. Seems like a weird local configuration somehow.

@jfversluis jfversluis added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. feedback-ticket Issue originates from https://developercommunity.visualstudio.com labels May 13, 2022
@ricardocesarcara
Copy link

@vsfeedback I have the same problem. Você encontrou uma solução?

@jpelaho
Copy link

jpelaho commented Dec 28, 2022

I have the same problem.

@erwink88
Copy link

erwink88 commented Aug 4, 2023

i have the same problem after updating to latest Visual Studio.
what I've done:

  • delete bin obj folder
  • moved out from source control

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feedback-ticket Issue originates from https://developercommunity.visualstudio.com s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.
Projects
None yet
Development

No branches or pull requests

5 participants