• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  • Sign In
Link to http://www.citrix.com Link to http://community.citrix.com
XenApp Developer Network

XenApp Community > Citrix Developer Network (CDN) Forums > XenApp Developer Network > XenApp Management SDK (MFCOM) > 4.5 exception hitting 4.0 servers

Thread: 4.5 exception hitting 4.0 servers


Permlink Replies: 1 - Pages: 1 - Last Post: Oct 9, 2007 10:00 AM Last Post By: Charles Stivali
Jay Conway

Posts: 6
4.5 exception hitting 4.0 servers
Posted: Oct 8, 2007 2:06 PM
  Click to reply to this thread Reply
This message was useful 0 users found this post useful
I am trying the 4.5 sdk against a 4.0 environment and I am consistantly encountering the following exception using vb.net 2005.

[i]System.InvalidCastException was unhandled by user code
Message="Unable to cast COM object of type 'MetaFrameCOM.MetaFrameFarmClass' to interface type 'MetaFrameCOM.IMetaFrameFarm7'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ED62F60E-63C2-11D4-94D8-00C04FB0F326}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
Source="Interop.MetaFrameCOM"
StackTrace:
at MetaFrameCOM.MetaFrameFarmClass.Initialize(MetaFrameObjectType FarmType)[/i]

here is the offending code. pretty simple stuff.

Imports MetaFrameCOM

Partial Public Class _Default
Inherits System.Web.UI.Page
Dim thefarm As New MetaFrameFarm

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
thefarm.Initialize(MetaFrameObjectType.MetaFrameWinFarmObject = 1)
Label1.Text = thefarm.FarmName
End If

End Sub
Charles Stivali

Posts: 1,354
Re: 4.5 exception hitting 4.0 servers
Posted: Oct 9, 2007 10:00 AM   in response to: Jay  Conway in response to: Jay Conway
  Click to reply to this thread Reply
This message was useful 0 users found this post useful
PS4 servers do not support the iMetaFrameFarm7 interface. The iMetaFrameFarm6 interface was the last one added for PS4. Based on your code, it does not appear as though you need anything specific from the iMetaFrameFarm7 interface. Try adding the following lines in bold (which should work with any Presentation Server version):

[b]Dim thefarm As iMetaFrameFarm[/b] 'Replaces original Dim
.
.
.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
[b]thefarm = New MetaFrameFarm()
thefarm = CreateObject("MetaFrameCOM.MetaFrameFarm","ServerName")[/b]
thefarm.Initialize(MetaFrameObjectType.MetaFrameWinFarmObject = 1)
 
  • Legend

    • Genius
      4000 + pts
      Virtuoso
      2000 - 3999 pts
      Master
      750 - 1999 pts
      Scholar
      250 - 749 pts
      Aficionado
      100 - 249 pts
      Enthusiast
      10 - 99 pts
      Citrite
      Helpful Answer
      Worth 2 points
      Correct Answer
      Worth 6 points