Click Once WPF application Upgrade failed with COMException (0x8007001F)

Eric Gao in Microsoft 1 Reputation point
2021-09-17T09:09:37.81+00:00

Hi all,
Our WPF application is still using Click Once to AUTO upgrade the version.

At the beginning of these years, it worked well. But in the past two or three years, we have continued to encounter the application auto upgrade failed problem.

Code:
ApplicationDeployment appDeployment = ApplicationDeployment.CurrentDeployment;
if (appDeployment.CheckForUpdate())
{
appDeployment.Update();
}

Exception:

An error occured in application: DefaultDomain A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F) The exception that occured was System.Runtime.InteropServices.COMException (0x8007001F): A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F) at System.Deployment.Internal.Isolation.IStore.Transact(IntPtr cOperation, StoreTransactionOperation[] rgOperations, UInt32[] rgDispositions, Int32[] rgResults) at System.Deployment.Internal.Isolation.Store.Transact(StoreTransactionOperation[] operations, UInt32[] rgDispositions, Int32[] rgResults) at System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext storeTxn, SubscriptionState subState) at System.Deployment.Application.ComponentStore.SubmitStoreTransactionCheckQuota(StoreTransactionContext storeTxn, SubscriptionState subState) at System.Deployment.Application.ComponentStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams) at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams) at System.Deployment.Application.DeploymentManager.SynchronizeCore(Boolean blocking) at System.Deployment.Application.ApplicationDeployment.Update()

After researching the source code of System.Deployment, we found it may cause by the below code, but we cann't enter a deeper source code:

1.System.Deployment.Internal.Isolation.Store.cs
public void Transact(System.Deployment.Internal.Isolation.StoreTransactionOperation[] operations, uint[] rgDispositions, int[] rgResults)
{
if ((operations == null) || (operations.Length == 0))
{
throw new ArgumentException("operations");
}
this._pStore.Transact(new IntPtr(operations.Length), operations, rgDispositions, rgResults);
}
2.System.Deployment.Internal.Isolation.IsolationInterop.cs
[return: MarshalAs(UnmanagedType.IUnknown)]
[SecurityCritical, DllImport("clr.dll", PreserveSig=false)]
private static extern object GetUserStore([In] uint Flags, [In] IntPtr hToken, [In] ref Guid riid);

We are still suffering from this error now. So, could the Microsoft donet team or other members help to provide the root cause of this exception and fix this issue? Thanks a lot.

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
316 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,099 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 24,276 Reputation points Microsoft Vendor
    2021-09-23T06:22:29.07+00:00

    @Eric Gao in Microsoft , based on my research, your problem is the similar with question clickonce-applications-fail-to-update.html.

    You could also report the problem about .NET in Developer Community.