We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add a Calender Exception in new project


I am debugging the Examples of create a new project with calender exception, but the Calender Exception cant display in mpp, how should i do it ?

this is my code:

    public void ProjectCreation()
        // ExStart:ProjectCreation
        // ExFor: Project
        // ExSummary: Shows how to work with a <see cref="Aspose.Tasks.Project"/> instance.
        var project = new Project();
        project.Set(Prj.WorkFormat, TimeUnitType.Hour); // set the desired project properties
        project.Set(Prj.NewTasksAreManual, false);

        // adding new tasks and set desired properties
        var task1 = project.RootTask.Children.Add("Task 1");
        task1.Set(Tsk.Start, new DateTime(2020, 2, 5, 8, 0, 0));
        task1.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
        task1.Set(Tsk.Finish, new DateTime(2020, 2, 5, 17, 0, 0));
        var task2 = project.RootTask.Children.Add("Task 2");
        task2.Set(Tsk.Start, new DateTime(2020, 2, 6, 8, 0, 0));
        task2.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
        task2.Set(Tsk.Finish, new DateTime(2020, 2, 6, 17, 0, 0));

        // adding new resources
        var workResource = project.Resources.Add("Work Resource");
        workResource.Set(Rsc.Type, ResourceType.Work);
        //workResource.Set(Rsc.rate, ResourceType.Work);
        var costResource = project.Resources.Add("Cost Resource");
        costResource.Set(Rsc.Type, ResourceType.Cost);

        // adding new resource assignments
        var workResourceAssignment = project.ResourceAssignments.Add(task1, workResource);
        workResourceAssignment.Set(Asn.Start, new DateTime(2020, 2, 5, 8, 0, 0));
        workResourceAssignment.Set(Asn.Work, project.GetWork(8));
        //workResourceAssignment.Set(Asn.RateScale, project.GetWork(8));
        workResourceAssignment.Set(Asn.Finish, new DateTime(2020, 2, 5, 17, 0, 0));
        var costResourceAssignment = project.ResourceAssignments.Add(task2, costResource);
        costResourceAssignment.Set(Asn.Start, new DateTime(2020, 2, 6, 8, 0, 0));
        costResourceAssignment.Set(Asn.Work, project.GetWork(8));
        costResourceAssignment.Set(Asn.Finish, new DateTime(2020, 2, 6, 17, 0, 0));

        var exception2 = new CalendarException();
        exception2.FromDate = new System.DateTime(2009, 1, 1);
        exception2.ToDate = new System.DateTime(2009, 1, 3);


        // save project in the one of available formats
        // here we are saving it in Microsoft Project XML file format.
        project.Save(OutDir + "ProjectCreation_out.mpp", SaveFileFormat.Mpp);

        Project project1 = new Project(OutDir + "ProjectCreation_out.mpp");

        project1.Save(OutDir + "ProjectCreation_out.mpp", SaveFileFormat.Mpp);
        // ExEnd:ProjectCreation

there is an issue on our side. The fix will be released in the next version (23.3).

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): TASKSNET-10786

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

i need your Paid Support.
out company was paid of your product Aspose.Total
how do i show you?

bwt,i seem like find other issues , :face_with_monocle:

you can check the following page: https://helpdesk.aspose.com/kb/faq/How-to-obtain-Paid-Support

feel free to post them as separate topics

The issues you have found earlier (filed as TASKSNET-10786) have been fixed in this update.