Remove-AppxPackage fails with error 0x80070002 - windows

I develop an app that I have installed/uninstalled multiple times from the Microsoft Store and deployed from Visual Studio.
Now Visual Studio refuses to deploy it anymore, blocking my debug. The error message it gives is that there is already a package with the same ID installed by another user.
When I try to remove the package, I use PowerShell as administrator and run:
Remove-AppxPackage -Package <package-name> -AllUsers
And receive the error:
Remove-AppxPackage : Removal failed. Please contact your software vendor.
Deployment Remove operation with target volume C: on Package
<package-name> from: failed with error 0x80070002. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
It seems there is a ghost instance of this package somewhere on the PC.
Are there any ways to clean this instance so I can fix this problem?

For me, when I tried this line I received the same error as you:
Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage -allusers
It worked when I did this:
Get-AppxPackage -allusers *MicrosoftOfficeHub* | Remove-AppxPackage

Disclaimer: any manipulation of the Registry could break your system's configuration. Be very careful if you attempt this method to uninstall an Appx.
I was able to uninstall an app like this:
Go to KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\. Look for the app's package name
Backup the key (right click, export)
Re/run the Remove-AppxPackage -Package <package-name> -AllUsers command

Related

Not getting any error log in Windows PowerShell while installing MSU

While I am trying to install MSU manually in the windows 2019 server, I am getting one error like
"The update is not applicable to your computer". Because some alternative KB has been installed already. So it's not allowed to install the MSU that I want to install. It's fine.
But when I am trying to install the same MSU through PowerShell by below mentioned PowerShell commend I am not getting any error log. I need a script to show the error log; if its any error. It has to skip this MSU installation. Experts please help me one this. I am looking forward to hear from you.
Start-Process -FilePath "$env:SystemRoot\System32\wusa.exe" -ArgumentList "C:\MicrosoftEdge_KB\windows10.0-kb4520062-x64.msu /quiet /norestart" -Wait

Issue installing Microsoft Visual Studio Professional 2017 - "A product matching the following parameters cannot be found" during installation

This error presents itself immediately upon first launch of the program following the attempted install.
click to enlarge
I have ran %programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe -full and then re-ran the installer and the issue still presents itself.
I have tried the solutions here and they did not resolve my issue.
I also tried both of the answers here.
Any guidance here or things to try next will be very helpful!
Here are my log files from when I tried this in March. They're old, but re-running this installation still shows the exact same error.
https://pastebin.com/7D2JwGKF
for i in 12 do this.function
try this one
Open a command prompt with admin privileges
Run following command (this will clean up previous install cache. -full option is important) "%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe" -full
Restart the installer
A product matching the following parameters cannot be found during VS Installation

Automate nuget update-package operation on many VS solutions

I've got 10+ Visual Studio solutions that are referencing a nuget package.
When I decide to update that package in every solution it's a very long work to open each solution manually, update its package and check-in all changes to TFS. I'd like to "automate" this process with a batch operation that does it on behalf of me.
I've made some experiments with nuget.exe by command line but it doesn't care about TFS read-only files: it overwrites the content of my files without checking-out them so this way seems not the best way to do it.
Any other suggestion to achieve the aim?
You can use nuget update command to do this. VS/TFS can detect the changes even thought you are running the command outside from VS. And usually, only "packages.config" file will be updated during the nuget package update.
Update:
Following is a simple code to find the solution files under the given path and update the nuget packages for the solution and then check in the pending changes via TFS PowerShell CommandLets (You need to install "TFS Power Tool" to use this commandlet). You can update according to your scenario.
param([String]$dirpath)
add-pssnapin Microsoft.TeamFoundation.PowerShell;
Get-ChildItem -Path $dirpath -Filter *.sln -Recurse | ForEach-Object { & nuget update $_.FullName 2>1; cd $_.Directory; get-tfspendingchange; new-tfschangeset}
Save the code as a powershell script and run it from Windows PowerShell with argument "-dirpath yoursolutionpath". It will run as following:
Download Nuget Comanline
nuget.exe restore YourSolution.sln
nuget.exe update YourSolution.sln
Nuget Docs

NuGet exited with code 3

I am facing an issue with enabling NuGet package restore. Once I enable package restore, all the projects fails to build correctly with the following error message
The command ".nuget\nuget.exe" install
" \packages.config" -source -Noninteractive -RequireConsent
-solutiondir "
I have tried to run the command from command prompt and it worked without errors.
I am using VS2012
I have found that the root cause of the issue is having em dash as part of the project folder name. Once I have removed the em dash from the name, the nuget restore worked without issues.
I have created a bug to the NuGet team and hopefully it will be resolved soon
https://github.com/NuGet/Home/issues/900

Project : error PRJ0050: Failed to register output

When I use Visual Studio 2008 on my XP, everything is fine. But when I use the same on my Vista, I always get this error message when compiling my Visual C++ project. How to fix this?
1>Project : error PRJ0050: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
Try launching visual studio with "Run as administrator" options. (Right-click->Run as administrator)
If that doesn't work, run dependency walker (depends.exe) on your DLL to see if anything is missing and try registering from an elevated command prompt using:
regsvr32 mydll.dll
regsvr32.exe should give more information about the failure.
I came across the same issue. Lines of investigation included User account controls, Disable Registration and missing Dependencies.
My issue was resolved when looking into output registration. Go to: Properties-> Linker -> General -> Register Output. Set this to No. You will need to do this for debug and release configurations.
This fixed my problem.

Resources