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
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...
Notes
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
User contributions licensed under CC BY-SA 3.0