Microsoft.Web.WebView2 / .NET Framework 4.8 WinForms application + Published application run-time error (REGDB_E_CLASSNOTREG)

2

We are using XenApp: 7.6. We have a .NET full framework 4.8 WinForms application as a published application within Citrix Receiver. This published application is hosted on a Windows Server 2008 R2 SP1 (64 bit) machine. Our application uses Microsoft.Web.WebView2 (1.0.824-prerelease) web browser Winforms control to provide an embedded web browser within our application.

Our application works without any issues when running as a regular desktop application on the same Windows Server 2008 R2 SP1 server used to deliver the published application. Our application also works without any issues when running as a regular desktop application on Windows 10 and Windows Server 2012.

When we launch our application as a published application via Citrix Receiver we see a REGDB_E_CLASSNOTREG error at runtime when the Microsoft.Web.WebView2 Winforms control attempts to create a webview2 environment. You can see the runtime exception below...

System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Web.WebView2.WinForms.WebView2.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
The same application works without any issues when launched via the same Citrix Receiver portal using a Citrix published desktop and not a Citrix published application. 

Using ProcMon on the server when launching the published application I can see our application ultimately makes a call into C:\Program Files (x86)\Microsoft\EdgeWebView\Application\89.0.774.54\EBWebView\x64\EmbeddedBrowserWebView.dll which I believe then launches the msedgewebview2.exe process. We can see the msedgewebview2.exe executable is being launched successfully for the published app. This is shown below with the command arguments passed to msedgewebview2.exe...

C:\Program Files (x86)\Microsoft\EdgeWebView\Application\89.0.774.54\msedgewebview2.exe" --embedded-browser-webview=1 --user-data-dir="C:\Users\Admin\AppData\Roaming\OurAppName\EBWebView" --no-default-browser-check --disable-component-extensions-with-background-pages --no-first-run --disable-default-apps --noerrdialogs --embedded-browser-webview-dpi-awareness=0 --disable-features=msEdgeOnRampFRE,msEdgeOnRampImport,msEdgeMGPFrev1,msEdgeSettingsImport,msEdgeSettingsImportV2,msReadAloud,msSyncEdgeCollections,msApplicationGuard,msEdgeTranslate,msEdgeReadingView,WebPayments,msSendClientDataHeader,msSendClientDataHeaderToEdgeServices,msImplicitSignin,SpareRendererForSitePerProcess --disable-popup-blocking --enable-features=ForwardMemoryPressureEventsToGpuProcess --internet-explorer-integration=none --js-flags="--harmony-weak-refs-with-cleanup-some --expose-gc" --winhttp-proxy-resolver --mojo-named-platform-channel-pipe=26740.36688.8089883041949745853

Things I have tried

  • I've used ProcMon to identify all CLSIDs being loaded when launching our application as a published Citrix application and verified all 32-bit & 64-bit CLSIDs exist. I've also attempted to re-register a number of DLL's using RegSvr32 in both System32 & SysWOW64 folders
  • I've used ProcMon to identify all dependencies being loaded and verified these dependencies exist. I used a combination of ProcMon and dependency walker to verify all DLLs are present.
  • I've veriried all COM permissions are correct via "dcomcnfg" & "mmc comexp.msc /32"
  • Attempted all steps here https://support.microsoft.com/en-us/topic/-access-denied-errors-and-applications-with-com-activation-fail-after-installing-july-2018-security-and-quality-rollup-updates-for-net-framework-fd3d7a3f-ca2f-6e87-c409-a5652175cf40 (Diasymreader.dll CLASSNOTREG)
  • Attempted to install several windows updates including August 2018 security & quality rollup - The Windows Server 2008 R2 SP1 (64 bit) operating system running the published applications appears up to date.
  • Attempted different screen resolutions, color depths on the endpoint/client machine
  • Attempted setting various compatibility modes for our executable on the server, disabled high DPI, direct composition, etc
  • Attempted both x64 & x86 release builds with debugging flags disabled - no PDBs
  • Added checks to ensure our application is running in an elevated administrator context
  • Attempted useLegacyV2RuntimeActivationPolicy="true" within app.config configuration/startup element
  • Attempted runtime/loadFromRemoteSources element within app.config element
  • Ensured app. manifest exists to work correctly with UAC
  • Checked local security policies on the server (I can't see any obvious issues)
  • Attempted embedded WebView2 run-time (both x64 & x86)
  • Attempted install & downloadd of the dedicated WebView2 run-time from https://developer.microsoft.com/en-us/microsoft-edge/webview2/ (both x86 & x64 versions)
  • Installed the latest version of Edge on the server running the published application
  • Added msedge.exe,msedgewebview2.exe,msedgewebview2 to each of the following registry keys to disable Citrix hooks...
    • HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\CtxHook\ExcludedImageNames
    • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\CtxHook64\ExcludedImageNames
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\CtxUvi\UviProcessExcludes

Key Differences

When launching our application as a published application via the Citrix Receiver portal as opposed to a regular desktop application, we see the following key differences via ProcMon...

  • We see calls into the registry to locate the following CLSIDs (we don't see these calls when launched via a regular desktop app)...
    • 60A417CA-F1AB-4307-801B-F96003F8938B - Host Object Helper
    • 9BA05972-F6A8-11CF-A442-00A0C90A8F39 - Shell Folder View Router
    • 0A29FF9E-7F9C-4437-8B11-F424491E3931 - NDP SymBinder CorSymBinder_SxS / Dia based SymReader (diasymreader.dl / mscoree.dll)l
    • FAE3D380-FEA4-4623-8C75-C6B61110B681\Instance - WindowsCodecs.dll
      • 0E25DC18-9F5E-48B1-80B3-D124E81B773B ColourTransformer (%SystemRoot%\system32\windowscodecsext.dll)
      • 05AF94D8-7174-4CD2-BE4A-4124B80EE4B8
      • 7835EAE8-BF14-49D1-93CE-533A407B2248
      • 7ED96837-96F0-4812-B211-F13C24117ED3
      • ABE3B9A4-257D-4B97-BD1A-294AF496222E
      • AC757296-3522-4E11-9862-C17BE5A1767E
  • I've verified the DLLs referenced in the above CLSIDs are present within System32 & SysWOW64
  • We see the PDB symbol reader at C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll being loaded.
  • Before any file is accessed we see calls into the registry at HKU.Default\Software\Citrix\SessionSfr\10
  • Our application runs under the WFICA32.EXE process on the endpoint which is a 32-bit process. We see our application launch on the server as a regular 64-bit process running under a domain user who belongs to the local administrator's group.

Notes

  • Whilst we have full admin privileges and our Winforms application is running under the context of a local administrator the Windows Server 2008 R2 SP1 server hosting the published application is on a domain and various group policies are applied.
  • Windows Firewall is completely disabled on the Windows Server 2008 R2 SP1 server hosting the published application

At this stage, I'm not sure what to try next. I would sincerely welcome any suggestions from the Citrix experts here within the community.

Thank you in advance for any suggestions or assistance you can provide.

Best wishes for now,

Ryan

citrix
webview2
xenapp
asked on Stack Overflow Mar 17, 2021 by RyanH • edited Mar 17, 2021 by Ritu pal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0