I am currently trying to fix a problem, where my program doesnt work on some laptops. Currently there are three laptops on which the program doesnt work. When starting the program on those following error message appears
ClassFactory kann angeforderte Klasse nicht liefern (Ausnahme von HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE))
Geworfene Exception: System.Runtime.InteropServices.COMException
bei System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
bei System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
bei System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
bei System.Windows.Forms.AxHost.CreateInstance()
bei System.Windows.Forms.AxHost.GetOcxCreate()
bei System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
bei System.Windows.Forms.AxHost.CreateHandle()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.AxHost.EndInit()
bei RemoteConnectTool.Form1.InitializeComponent() in C:\Users\username\Documents\GitRepos\Tools\RemoteConnectTool\RemoteConnectTool\Form1.Designer.cs:Zeile 94.
bei RemoteConnectTool.Form1..ctor() in C:\Users\myUsername\Documents\GitRepos\Tools\RemoteConnectTool\RemoteConnectTool\Form1.cs:Zeile 24.
bei RemoteConnectTool.Program.Main() in C:\Users\myUsername\Documents\GitRepos\Tools\RemoteConnectTool\RemoteConnectTool\Program.cs:Zeile 18.
On those laptops, it also doesnt work with my personal username, on which it worked on my laptop. Some posts suggest reregister the class using regsvr32. But what what DLL do I need to add, in order to get the program running.
The weird thing is, when the program doesnt work, the error states my username instead of the logged in username.
It happens on Win10/Win11.
Program.cs Line 18:
Application.Run(new Form1());
Form1.cs Line 24
ADUser = new List<User>();
Start the program
Other laptops
Other users
Rebuilding the project
AxMSTSCLib
corresponds to this Remote Desktop ActiveX control, located in in \windows\system32\mstscax.dll
.
This "Microsoft RDP Client Control" (that's its display name) serves many versions of the main class called RdpClient
, currently from 1 to 13.
0x80040111
error, aka CLASS_E_CLASSNOTAVAILABLE
means the code is asking for a version of RdpClient
that's not available on the PC it currently runs.
It's a setup deployment/issue, i.e. the program was developed on a PC that has a higher version than the program it runs. You can review your .cs
files or your form.designer.cs
, check for code like new AxMSTSCLib.AxMsRdpClient11()
and try a lower version like AxMsRdpClient9
, etc.