Quantcast
Viewing all articles
Browse latest Browse all 2206

New Post: How to return TaskDefinition in WCF method?

On version 2.5.1.0. Followed service definition would get error

Type 'Microsoft.Win32.TaskScheduler.TaskDefinition' cannot be IXmlSerializable and have DataContractAttribute attribute.
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        void DoWork();

        [OperationContract]
        TaskDefinition GetTask();    //this will fail
    }
Reads TaskDefinition's attributes
    /// <summary>
    /// Defines all the components of a task, such as the task settings, triggers, actions, and registration information.
    /// </summary>
    [XmlRootAttribute("Task", Namespace = TaskDefinition.tns, IsNullable = false)]
    [XmlSchemaProvider("GetV1SchemaFile")]
    [DataContract(Name = "Task", Namespace = TaskDefinition.tns)]
    public sealed class TaskDefinition : IDisposable, IXmlSerializable

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>