WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

After updating Windows 10, Windows can no longer manage any appx packages, and I can't deploy WinUI 3 apps from VS

Open kmgallahan opened this issue 2 years ago • 49 comments

I just updated ~Visual Studio to 17.13.0 Preview 1 and~ Windows to 19045.5131.

Now Visual Studio can no longer deploy WinUI 3 apps, I can't uninstall any apps, the Microsoft Store can't update any apps, and trying a different account also results in the Store malfunctioning.

It seems Windows has lost its ability to manage packages.

@DrusTheAxe From what I've seen you are an expert in this area. Any suggestions for how to approach this?

VS error is:

DEP0900: Failed to unregister application "myappid". [0x80073CFA] 

kmgallahan avatar Nov 14 '24 02:11 kmgallahan

Can confirm. All our devs with win10 22H2 19045.5131, 19045.5011 machines faced with this issue. No problems for devs with win11 23H2 and above.

Just quick note, I think Visual Studio update is not the reason of this issue. We faced it on VS 17.9.7.

Related .NET MAUI topic: https://github.com/dotnet/maui/issues/25832

Xo3-ToBapbl avatar Nov 14 '24 09:11 Xo3-ToBapbl

We experienced the same issue and identified Windows update KB5046613 as the cause.

sigroli avatar Nov 14 '24 11:11 sigroli

Uninstalling KB5046613 does not help

riesem avatar Nov 14 '24 12:11 riesem

Every time.

"I think I'll update some packages. I may as well update VS while I'm at it. Oh, it suggests a restart. Ah, Windows wants to update during the restart."

~

"I wonder how much time & money this is going to cost me."


Only "solution" I've found is a clean install, which isn't a solution at all. Maybe now that millions are impacted Microsoft will throw together some sort of fix...

kmgallahan avatar Nov 14 '24 12:11 kmgallahan

Same problem here, how you "clean install" ? i am noobie in C# development. Do you click "Clean Solution" and Rebuild ?

S4nt1ag0 avatar Nov 14 '24 13:11 S4nt1ag0

@S4nt1ag0 clean install the whole OS. while im at it, im installing win11. it seems that win10 is really dying already.

ivanjx avatar Nov 14 '24 13:11 ivanjx

#MeToo right after Windows update.

axa88 avatar Nov 15 '24 09:11 axa88

I had this issue with .NET 8 and Windows 10 22H2 19060.1000.0. Upgrading to Windows 11 was unfortunately the only thing that worked.

dillonricketts avatar Nov 15 '24 18:11 dillonricketts

I'm currently having this issue on Win10 22H2 builds 19045.5011 and 19045.5131. We started noticing this issue on 11/12.

robertbrestle avatar Nov 15 '24 20:11 robertbrestle

Please look at this. The discussion started here and lead up to the stated temporary solution.

subratb avatar Nov 15 '24 21:11 subratb

@subratb That looks like a different issue, and it is a month old. This one is brand new this week.

kmgallahan avatar Nov 15 '24 23:11 kmgallahan

Experiencing the same here. Pretty much dead in the water until a fix is released. All development has been blocked.

StevoSM avatar Nov 16 '24 03:11 StevoSM

@StevoSM You can just stick this in your csproj files to make them unpackaged until a fix is available - unless they require something only packages support.

        <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
        <WindowsPackageType>None</WindowsPackageType>

kmgallahan avatar Nov 16 '24 03:11 kmgallahan

I am now having same issue.

I added the above lines to my project file, first in an existing property group, now in their own as follows: Image

Restarted Visual Studio, did a Clean and Rebuild Solution, but still get Image

even though deploy option is set Image

johnt-star avatar Nov 16 '24 16:11 johnt-star

@johnt-star You need to change your configuration selection to Unpackaged.

Image

kmgallahan avatar Nov 16 '24 17:11 kmgallahan

Thanks kmgallahan!

I no longer get the deployment error dialog after changing to Unpackaged.

Unfortunately after upgrading Visual Studio to the latest version, updating nuget packages where appropriate and installing .Net 9, I am now getting exceptions for things that use to work.

At least I can see what has changed and hopefully resolve them in order to get my app running again.

Appreciate the help!

johnt-star avatar Nov 16 '24 18:11 johnt-star

One thing I had to do was add this to resolve some ref issues:

<OutputPath>$(SolutionDir)bin\$(Configuration)\</OutputPath>

kmgallahan avatar Nov 16 '24 18:11 kmgallahan

There was an issue in the WinAppSDK 1.6.2 release which affected Windows 10 version 19045 machines. The 1.6.2 release has been pulled to prevent more machines being impacted.

This issue was not caused by an update to Windows and will not be fixed by uninstalling any Windows Cumulative Updates.

There is an upcoming Windows Update which will fix this issue (adding extra safety in Windows), and a release of WinAppSDK 1.6.3 is coming soon with a fix.

Machines in a bad state can also be manually fixed by running these steps:

  1. Launch a PowerShell or Command Prompt as Administrator and run these commands:
takeown /F "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x64__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll"
icacls "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x64__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll" /grant Administrators:F
del "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x64__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll"
takeown /F "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x86__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll"
icacls "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x86__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll" /grant Administrators:F
del "C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.6_6000.311.13.0_x86__8wekyb3d8bbwe\WindowsAppRuntime.DeploymentExtensions.OneCore.dll"
  1. Reboot
  2. Launch a PowerShell as Administrator and run these commands:
Get-AppxPackage *WinAppRuntime.Main.1.6* -AllUsers | Where { $_.Version -eq '6000.311.13.0' } | Remove-AppxPackage -AllUsers
Get-AppxPackage *MicrosoftCorporationII.WinAppRuntime.Singleton* -AllUsers | Where { $_.Version -eq '6000.311.13.0' } | Remove-AppxPackage -AllUsers
Get-AppxPackage *Microsoft.WinAppRuntime.DDLM* -AllUsers | Where { $_.Version -eq '6000.311.13.0' } | Remove-AppxPackage -AllUsers
Get-Appxpackage *WindowsAppRuntime.1.6* -AllUsers | Where { $_.Version -eq '6000.311.13.0' } | Remove-AppxPackage -AllUsers
Investigations are continuing and we'll provide further updates when available.

If you have an app project referencing the Microsoft.WindowsAppSDK package version 1.6.241106002, update the project to instead reference version 1.6.240923002. Removing version 1.6.241106002 from your local NuGet cache (such as C:\Users\<username>\.nuget\packages\microsoft.windowsappsdk\1.6.241106002) is also recommended to avoid accidental usage.

Investigations are continuing and we'll provide further updates when available.

codendone avatar Nov 17 '24 06:11 codendone

@codendone Thanks for the update. I don't know how helpful this might be, but we are only on WinAppSDK 1.4 and are experiencing the issue. We have not yet updated to 1.6 at all. In our environment, it must be the result of a Windows update or possibly that combined with a Visual Studio 2022 update. Note also we cannot run Slack as it is in a state of needing to be updated by the Windows Store app, and the Windows Store app is not able to successfully complete app updates due to this same issue.

StevoSM avatar Nov 17 '24 06:11 StevoSM

@StevoSM There must be a different app on the system which is using 1.6. Running Get-Appxpackage *WindowsAppRuntime.1.6* -AllUsers in an administrative PowerShell can help see those.

codendone avatar Nov 17 '24 06:11 codendone