0

I have a uwp - desktop bridge app (SyncFolder - a folder sync/copy app) in the Windows Store which delegates copying, scanning folders etc. to a win32 process that is launched from the uwp part as a fulltrust process. As follows:

public static async Task<bool> LaunchWin32ProcessAsync(string groupId = null, string dynamicParameters = null)
{
  try
  {
    if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
    {
      if (dynamicParameters != null)
      {
        Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
        localSettings.Values["Win32DynParms"] = dynamicParameters;
      }
      if (groupId == null)
      {
        await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
      }
      else
      {
        await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(groupId);
      }
      return true;
    }
  }
  catch (Exception e)
  {
    ConditionalFileLogger.Log($"Win32RequestHelper - Exception: {e.Message}");
  }
  return false;
}

The app is being used by thousands of people and works as it should, but some users (I got 3 reports over the last 2 years), even ones where the app runs successfully for months, occasionally report an error indicating that the full trust process is not launched.

There is a check in the app which looks for an AppService connection to be established by the win32 process. The error indicates that 20s after the launch the win32 process hasn't created the connection. There is also some logging in the win32 process in case the process would run, but there is no entry in the log file (or the log file simple doesn't exist). So I have to assume that windows hasn't launched the process.

Does someone know what could cause Windows not to launch this win32 process?

Jos Huybrighs
  • 73
  • 1
  • 5
  • Can you reproduce this problem stable, and is there any error log or dump file could be shared? – CoCaIceDew May 16 '22 at 08:10
  • @CoCaIceDew No, it is not reproducable. There is also no usable log. The win32 process apparently is not launched, which the app only founds out because it expects a AppService connection to be established which it monitors using a 20s timer. A recent feedback of a user who experienced this tells me that – Jos Huybrighs May 16 '22 at 11:44
  • @CoCaIceDew A recent feedback of a user who experienced this, refers to a recent Windows update that apparently had errors in the area of the .Net Framework (other Windows apps such as Log Viewer stopped working also). There is probably not a lot we can do about such situations unless the launch api had a return code that could point to such error. – Jos Huybrighs May 16 '22 at 11:54
  • Have you tried to update your app's target version to latest ? – CoCaIceDew May 17 '22 at 01:29
  • 1
    @CoCalceDew The UWP part is still targetting 1903, but the win32 part is .Net Framework 4.8 so that should be OK. I will update the UWP app to the latest target and will see if there will still be error reports. Thanks for the recommendation! – Jos Huybrighs May 17 '22 at 21:25
  • Any result could be share ? – CoCaIceDew May 20 '22 at 01:18

0 Answers0