Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building RDP into a C# app

Tags:

c#

rdp

I'm currently trying to build RDP into an application that I've made. We constantly have to connect to many servers regularly and would like to eliminate the need for our employees to know the details to all the servers.

I'm currently trying to use the example at: http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx

When using the above I receive the error below:

Retrieving the COM class factory for component with CLSID {791FA017-2DE3-492E-ACC5-53C67A2B94D0} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

From this code:

MsRdpClient rdp1;
rdp1 = new MSTSCLib.MsRdpClient();

Any help would be much appreciated, thanks.

like image 424
Apparatus Avatar asked Nov 13 '22 08:11

Apparatus


1 Answers

Set your Visual Studio project as x86 build.

Project Properties -> Build Tab -> Platform Target -> x86

enter image description here

If not helps than try to register com dll via regsvr32.

like image 104
Daniil Avatar answered Nov 14 '22 21:11

Daniil