question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repeatedly building and deploying causes deployment errors due to file being held by another process error.

See original GitHub issue

Repeatedly building and running a winui desktop C# app ends up with a build failure sometimes. You can recover by restarting visual studio. Also, I notice that sometimes rebuilding and F5 from visual studio does not terminate the app instance that is already running.

Here is the error message when it fails.

Updating the layout... 
Copying files: Total <1 mb to layout... 
DEP1000: Cannot copy file "BlankPreview2CsDesktopApp\BlankPreview2CsDesktopApp\bin\x86\Debug\net5.0\win-x86\BlankPreview2CsDesktopApp\App.xbf" to layout "BlankPreview2CsDesktopApp\BlankPreview2CsDesktopApp (Package)\bin\x86\Debug\AppX\BlankPreview2CsDesktopApp\App.xbf". IOException - The process cannot access the file 'BlankPreview2CsDesktopApp\BlankPreview2CsDesktopApp (Package)\bin\x86\Debug\AppX\BlankPreview2CsDesktopApp\App.xbf' because it is being used by another process. [0x80070020] 
3>Deployment of the application to the target device failed 
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== 
========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== 

NuGet package version: [Microsoft.WinUI 3.0.0-preview2.200713.0]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fabiant3commented, Jul 31, 2020

@ranjeshj - what is the process holding onto your build? Process Explorer will tell ya.

0reactions
evelynwu-msftcommented, Jul 10, 2023
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build error: "The process cannot access the file because it ...
c# - Build error: "The process cannot access the file because it is being used by another process" - Stack Overflow.
Read more >
Troubleshoot common Azure deployment errors
Error code Mitigation More inform... AccountNameInvalid Follow naming guidelines for storage accounts. Resolve erro... AccountPropertyCannotBeSet Check available storage account properties. storageAcco... AnotherOperationInProgress Wait for concurrent operation...
Read more >
Troubleshooting Build Errors
Learn how to resolve common scenarios you may encounter during the Build step, including build errors that cancel a deployment and long build...
Read more >
Troubleshoot EC2/On-Premises deployment issues
Troubleshoot deployment issues you might encounter when you use CodeDeploy to deploy to an EC2/On-Premises compute platform.
Read more >
“Error building project: The build hook failed with status code 1”.
Solution · Check to ensure that there is enough storage. · Ensure ECE-Tools are configured correctly. · Check if it is the patch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found