Search code examples
c#visual-studioapixenapp

Unable to Properly Add References for Citrix to C# Application


I am trying to build an application for Citrix users to end their own session. I originally coded this myself, but then I found this post:

C# How do I log off a Citrix XenApp User Session?

But I am unable to emulate it. When I add the using Citrix; references, I am seeing "The type or namespace could not be found."

Do I need to install something for this? I have searched the internet for this, but all I could find was a download for what is apparently the XenServer-SDK (is this correct?)

Even then, I added the .dlls in Visual Studio, and references like so:

 using CookComputing;
 using XenServer;

However, I am seeing the same message for these (they are not recognised by Visual Studio).

My original solution does work, but I think I may be able to program a much cleaner solution by using APIs.

Please can someone point me in the right direction? Any help on this is much appreciated!

Many thanks


Solution

  • If you need to stop XenApp session, then you need XenApp SDK (not XenServer). You can download SDK from Citrix site.

    Then in your project add references to dlls located in %ProgramFiles%\Citrix\XenApp Server SDK\bin (for XenApp 6.0):

    • Citrix.Management.Automation.dll
    • Citrix.XenApp.Sdk.dll
    • other dlls depending on what you will use

    And then add using directives to your .cs file:

    using Citrix.Common.Sdk;
    using Citrix.XenApp.Sdk;
    using Citrix.XenApp.Commands;
    using Citrix.Management.Automation;