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

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

Related

Visual Studio Code on Windows server 2008

Can I install Visual Studio Code on Windows server 2008 ?
I am a developer but I sent the information to my administrators and they told me that the setup file crashes after launched
I get seput file from hee https://code.visualstudio.com/download
procesor: Intel(R) Xeon(R) Gold 6142 CPU # 2.60Ghz - 2.59 GHz
RAM: 8 GB
64-bit
virtual machine
1 CPU - 2 cores
Windows Server 2008
First time answering here so bare with my vintage reply formatting. (also pardon that i couldn't capture screen due to server is on a intranet that not accessible on this device causing a long reply)
Being a unfortunate fellow that need to work on legacy Systems and Application frequently, i happen to have a fresh 2008R2 server recently setup by my team's Server Admin with following specs:
processor: Intel(R) Xeon(R) Gold 5220 CPU # 2.20Ghz - 2.19 GHz ,
OS: Windows Server 2008R2 x64 ,
RAM: 8GB
The versions that is able to install was 1.70.3,which is the same version that is the last supporting versions for Windows 7 as well,if you happen to need to work on devices using that OS version.
although i'm uncertain whether it is a VM or not, i'd like to point out a few more things that your question did not cover but need to consider:
The installer version (System setup vs User Setup)
aside from the x64 |x86 | ARM installer differences, as you've not mentioned which versions of the build and which exact setup installer you sent to your admin, i've first replied which build version successfully installed on 2008R2, which as of writing the latest build was 1.73.0 and on run,it pop up a error message as follow regardless of System/User Setup:
This Program does not support the version of windows your computer is running.
in our current case that we want specific previous versions installer, VScode FAQ on previous versions have a URL lists that enables you to download a specific build version of your preferred setup. For my case (and also refer below to exactly why this one), i've go for System setup, and i know the aprox. supporting version was ~1.70.0, so i used the link as below and replace the {version} to start:
https://update.code.visualstudio.com/{version}/win32-x64/stable
Active Domain, Multiple user sessions etc.
Per VSCode requirements page stated,
VS Code does not support multiple simultaneous users using the software on the same machine, including shared virtual desktop
infrastructure machines or a pooled Windows/Linux Virtual Desktop host
pool.
as im not sure do you work solo or do have fellow colleagues to code on the server at the same time, you might need to reconsider to install using user or System setup.
if your intentions are to use exclusively on a specific AD account, then user setup should probably be good enough.
however, if the intentions was to setup say a shared Remote desktop connections on the VM that allows multiple RDC sessions simultaneously for coding,programming etc., so you intend to install a system setup to allow all users on said server to be able to use VScode, then you might run into the problem the VScode requirements stated it does not support.
in addition, as i was remote connected as administrator , when using a 1.70.2 user setup ,a different warning message as follow was thrown:
This user Installer is not meant to be run as Administrator. If you would like to install VS Code for all users in this system, download the system Installer instead.Are you sure you want to continue?
as the installer itself also checks with the operator on this matter, your admin may have skipped on the exact reasons why the install failed and just told you the installer crashed.
if you absolutely need VScode to run on the server but can't install for reasons, the last resort (aside from going for alternatives like notepad++) is to Setup a Portable Mode builds on your own workstation/devices first, then upload the package to the server and use it from there.
i wouldn't go into too much detail in that as this reply already span for a starwars trilogy length but keep in mind, version limitations still apply, and whatever add-ons you need, you need to download them first before bundle it into the package to upload and run on your server.
Anyone that is a System admin or infrastructure architects , do correct me on my novice understanding on Server settings etc. as although i'm primarily a programmer, i did end up touching a lot more things that i'm not specialized into over the few years of vendor career work so there bound to be incorrect/inaccurate concepts i spilled. cheers.

Server Manager not available/accessible after removing .Net feature in widows server 2019

I have removed .Net Framework feature from "Server Manager -> Remove Roles and features Wizard".
(This image is from a different server)
Later I noticed that this activity has affected many windows features (Server manager, IIS Manager, Turn on off windows features etc..).
After removed .Net Framework feature I was not able to find the Server Manager application.
I tried answer in this link and able to restore ServerManager.exe but once I try to load the server manager it's giving below error,
I may be able to resolve this if I can re enable .Net frame work feature. But not sure how to do that without using server manager(since I cannot open sever manager).
Appreciate any solutions or suggestions regarding this.
Finally able to re enable .Net feature and access server manager by following below steps,
Open command prompt
Run the command: dism /online /enable-feature /featurename:NetFx4ServerFeatures /ALL and press return.
Type PowerShell and press enter.
Run the command: Install-WindowsFeature PowerShellRoot,PowerShell,PowerShell-ISE.
Restart the server.
Credit belongs to this blogger:
https://glennopedia.com/2020/02/14/why-you-shouldnt-remove-net-in-windows-server/
This kind of errors are caused due to lack of .NET framework on your machine or if you installed old version of framework. You need to install an appropriate .NET Framework on your computer.
Updating .NET framework on your computer will solve your problem maximum.
Install it from the Microsoft website.
Run as Administrator , the server manager will open.
Now you can try to add.

Lightswitch Desktop Application Wont Run in XP SP3

I have developed an application in Lightswitch 2012, and now need to deploy it to a desktop PC running XP SP3.
I have already looked at two previous posts Can't run Lightswitch 2012 Programm under Windows XP and
Lightswitch Desktop Application Wont Install in XP SP3
The two posts both refer to executing [editbin vslshost.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1] to modify the vslshost.exe file, though only the first post says it worked.
In my case, I have tried the above to update the vslshost.exe file, but when I publish my LS2012 project it reverts back to the default vslshost.exe file. And if I manually swap the file with the copy I modified, when I run the deployed app I get the following error:
System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, vslshost.exe, has a different computed hash than specified in manifest.
- Source: System.Deployment
So, the questions are
am I doing something wrong?
is there a master copy of vslshost.exe I need to update instead?
(BTW, I also ran the VS2012 (KB270250 from VS2012 Update 1 CTP 4))
Thanks for your help
As this is an internal company app, I have just convinced our IT guy to upgrade the machine, because the certain grief of trying the different possible solutions was just too much.
BUT if you MUST deploy to XP
To find out more, here are two pretty exhaustive posts with input directly from the Lightswitch team:
Progress on LS2012 desktop apps installing AND running on XP yet?
Windows XP 32 bit deployment
Enjoy....(???)

Active Report closing VB6 Application

I am running a VB6 with ActiveReports Standard v2 sp3. All of the sudden on one installation when creating a report the application shuts down. Eventually the system wants to report the error to Microsoft on actrpt2.dll Version 2.0.0.1252. If I copy the the clients database down on my machine it runs just fine. We have tried it on several machines. I have reinstalled the application. Reregistered the DLL. The client is using a terminal server running Server 2003. It is simply a columnar report.
I would have suspected a dependency issue for actrpt2.dll.
Check the dependency on your machine and do the same on the clients machine that this is failing.
For details on checking dependency
May be it is best to contact Grape City folks their forum is pretty active.
Update: if you are using win32 version of AR (not the dot net version of active reports).
Try dependency walker to check dependancy

WatiN Compatibility with Windows

I am running tests successfully on Windows XP but not even got a single successful build while running through Windows 2003.
Any one knows whether it is compatible or not as I read on some site that WatiN is fully tested on XP and not on other Windows editions.
I'd ordinarily post this as a comment on Sam's answer, but I'm trying to make a stack trace searchable, so here goes...
WatiN.Core.Exceptions.IENotFoundException : Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds.
at WatiN.Core.IE.CreateIEPartiallyInitializedInNewProcess()
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)
at WatiN.Core.IE..ctor(String url, Boolean createInNewProcess)
c:\...\WithVendorSite.cs(42,0): at WithVendorSite.VerifyCanLogIn(TargetSite target)
I developed my test on Windows 7 against WatiN 2.0.10.928 but the test was continually getting stuck with a blank browser with about:blank in the address bar when run on Windows Server 2008 with latest WUs, and Enhanced Security Configuration turned off and running the tests elevated (Run as Administrator).
The problem in my case (thanks Sam) was the absence of Microsoft.mshtml.dll in the bin directory (I had figured out Interop.shdocvw.dll was necessary from error messages I'd encountered on the Windows 7 side).
After adding Microsoft.mshtml.dll, things run happily with ESC turned back [but the test process needs to run elevated].
I run our WatiN integration test suite (hundreds of tests) on Windows 2003 with IE6. Works fine, no special tricks done. What is the exception you are getting? Are you sure mshtml.dll (the COM dll somewhere in the windows directory) is registered correctly on this machine? Do you have the Microsoft.mshtml.dll (interop assembly) and interop.shdocvw.dll in the same directory as WatiN.Core.dll?
Update: Its officially supported, from the faq
Which windows versions are supported?
Windows 2000, Windows XP, Windows 2003
and Windows 2008.
Original post:
I use it on vista all the time. I haven't used it on windows server 2003 though.
Have you tried logging on interactively into the server and trying to run the tests manually? It may be because of the account that your build server is running under or some particular security settings you have setup. Have you checked to see if IE is stopping you from viewing the page due to it not being in the trusted sites list?
I was using Watin 1.3 on Windows XP but the same on Win 7 having problem....
Officially Watin 1.3 works on O.S. Xp and earlier on Win XP
But Watin 2.1 works fine on Win 7 and XP.
Officially Watin 2.1 supports any Microsoft O.S.