locked
Class SubscriptionInfo no longer in Microsoft.TeamFoundation.Server (VS2010)? RRS feed

  • Question

  • I can see that the SubscriptionInfo class is no longer present in Microsoft.TeamFoundation.Server (VS2010), 

     

    until now, I could use code like:

    using Microsoft.TeamFoundation.Server;

    ...

    public void Notify(string eventXml, string tfsIdentityXml, SubscriptionInfo SubscriptionInfo)

            {}

     

    but after migrating to a new version it seems the SubscriptionInfo is no longer supported, 

     

    Does anyone know any workarounds to this? 

    Tuesday, October 26, 2010 5:24 PM

Answers

  • Ive noticed the same, and this solved it for me at the moment.

    namespace EventSubscriber
    {
      [ServiceContract(Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
      public interface INotificationService
      {
    
    
        [OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify", ReplyAction="*")]
        [XmlSerializerFormat(Style = OperationFormatStyle.Document)] /* Took me hours to figure this out! */
        void Notify(string eventXml, string tfsIdentityXml, SubscriptionInfo SubscriptionInfo);
    
    
      }
    
      [Serializable]
      [XmlRoot(ElementName = "SubscriptionInfo", IsNullable= false)]
      [XmlType(TypeName= "SubscriptionInfo")]
      [DataContract(Namespace="http://scheams.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
      public class SubscriptionInfo
      {
        public SubscriptionInfo()
        {
        }
    
        private int _ID;
    
        [XmlElement(ElementName = "ID", IsNullable = false, DataType = "int")]
        public int ID
        {
          get { return _ID; }
          set { _ID = value; }
        }
    
        private string _classification;
    
        [XmlElement(ElementName = "Classification", IsNullable = true, DataType = "string")]
        public string Classification
        {
          get { return _classification; }
          set { _classification = value; }
        }
    
        private string _subscriber;
    
        [XmlElement(ElementName = "Subscriber", IsNullable = true, DataType = "string")]
        public string Subscriber
        {
          get { return _subscriber; }
          set { _subscriber = value; }
        }
      }
    
    
    }
    
    

    Tuesday, October 26, 2010 5:37 PM
  • Hi,

    You can also use

    public void Notify(string eventXml, string tfsIdentityXml)

    SubscriptionInfo  is not necessary.


    Best regards,
    Ruiz


    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, November 9, 2010 4:37 PM
    Moderator

All replies

  • Ive noticed the same, and this solved it for me at the moment.

    namespace EventSubscriber
    {
      [ServiceContract(Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
      public interface INotificationService
      {
    
    
        [OperationContract(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify", ReplyAction="*")]
        [XmlSerializerFormat(Style = OperationFormatStyle.Document)] /* Took me hours to figure this out! */
        void Notify(string eventXml, string tfsIdentityXml, SubscriptionInfo SubscriptionInfo);
    
    
      }
    
      [Serializable]
      [XmlRoot(ElementName = "SubscriptionInfo", IsNullable= false)]
      [XmlType(TypeName= "SubscriptionInfo")]
      [DataContract(Namespace="http://scheams.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
      public class SubscriptionInfo
      {
        public SubscriptionInfo()
        {
        }
    
        private int _ID;
    
        [XmlElement(ElementName = "ID", IsNullable = false, DataType = "int")]
        public int ID
        {
          get { return _ID; }
          set { _ID = value; }
        }
    
        private string _classification;
    
        [XmlElement(ElementName = "Classification", IsNullable = true, DataType = "string")]
        public string Classification
        {
          get { return _classification; }
          set { _classification = value; }
        }
    
        private string _subscriber;
    
        [XmlElement(ElementName = "Subscriber", IsNullable = true, DataType = "string")]
        public string Subscriber
        {
          get { return _subscriber; }
          set { _subscriber = value; }
        }
      }
    
    
    }
    
    

    Tuesday, October 26, 2010 5:37 PM
  • Hi,

    You can also use

    public void Notify(string eventXml, string tfsIdentityXml)

    SubscriptionInfo  is not necessary.


    Best regards,
    Ruiz


    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, November 9, 2010 4:37 PM
    Moderator