use AxImp /source c:\windows\system32\MSTSC.dll to generate the source code of AxMSTSCLib.dll(AxMSTSCLib.cs), then you can include it in your project, thus you do not need AxMSTSCLib.dll.
what’s more, you can even remove MSTSCLib.dll by manually defining the interface classes.
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you have drag and drop a Terminal
Services Control on a windows form, a compiler error was generated. If
there is any misunderstanding, please feel free to let me know.
Based on my research, this is a known issue. The wrapper generater fails to
generate correct method for returning an enum value. Here is a workaround.
%<SDK bin directory>%\aximp.exe %windir%\system32\mstscax.dll
This will generate MSTSCLib.dll and AxMSTSCLib.dll.
Make sure Interop.MSTSCLib.dll and AxInterop.MSTSCLib.dll have been deleted
in the obj and bin\Debug directories.
- Copy the generated files (without renaming) - MSTSCLib.dll and
AxMSTSCLib.dll into the project’s obj directory.
- In the project’s references, add MSTSCLib.dll and AxMSTSCLib.dll from
the obj directories.
- Now, instead of drag-drop’ing the control from the toolbox, write code
to add the control:
Goto Form.cs code view
private AxMSTSCLib.AxMsTscAx axMsTscAx1;