I want to debug my own UWP programs and I have to replace the dlls in the installed location. But I cannot replace or add any files into the folder because the permissions is denied, how can I do that? I have tried many ways such as take ownership or sign as administrator, but none of them works. Any help will be highly appreciated
-
you don't open that folder, you just add the dll to the package when building the appx package. What kind of dll you want to replace? – kennyzx Sep 10 '18 at 09:29
-
I think the bug occurs in the dll, So I rebuild the dll without optimization so that I can remote debug, So I have to replace it – Z.zip Sep 11 '18 at 02:57
-
when you are debugging locally, the dll is copied to the `Appx` folder under bin folder the project, it is not in `WindowsApp` folder. If you want to debug remotely, just replace the optimized dll in the package with the un-optimized one, and rebuild the package, then install the package in the remote machine. You don't need to open the `WindowsApp` folder to replace the dll in-place. – kennyzx Sep 11 '18 at 03:06
-
thanks a lot, But I do not think that's a good way when the package is very big – Z.zip Sep 11 '18 at 14:28
1 Answers
You can access the files inside the WindowsApps folder but only in read-only manner. While it is technically possible to replace files of an app, it is not possible to replace files of an installed app. This would break the integrity of the package and that is verified before the app is launched by the system, so any modification will cause the app not to launch successfully.
However if you just want to access the folder, you can follow the instructions on my brother's blog or here.
Beware
All changes below are at your own risk, as you are modifying the permissions of a system folder and that could potentially cause issues
Go to C:\Program Files
and right click the WindowsApps
folder. Select Properties and go to Security tab. Click the Advanced button. Click the Continue button to give yourself administrative permissions.
Next, click the Change button to change the owner and in the newly opened dialog's "Enter the object name to select field enter your username or e-mail (in case you use Microsoft Account). Finally apply the setting on subcontainers by checking the Replace owner on subcontainers and objects field.
Now click Apply and wait until the permissions are granted for all existing items and that should do it :-) .

- 1
- 1

- 38,440
- 7
- 70
- 91
-
1I usually launch an elevated `cmd.exe` to view the contents of this folder. With the most profound warnings to never do any changes in there whatsoever. – Stein Åsmul Sep 10 '18 at 20:32
-
-
How do you revert the changes; I want to undo what I did, and cannot recall the owner, was it `TrustedInstaller`, even so it cannot take ownership again. – Wayne Aug 29 '23 at 06:52