net.sf.mpxj-for-csharp
13.12.0
dotnet add package net.sf.mpxj-for-csharp --version 13.12.0
NuGet\Install-Package net.sf.mpxj-for-csharp -Version 13.12.0
<PackageReference Include="net.sf.mpxj-for-csharp" Version="13.12.0" />
<PackageVersion Include="net.sf.mpxj-for-csharp" Version="13.12.0" />
<PackageReference Include="net.sf.mpxj-for-csharp" />
paket add net.sf.mpxj-for-csharp --version 13.12.0
#r "nuget: net.sf.mpxj-for-csharp, 13.12.0"
#addin nuget:?package=net.sf.mpxj-for-csharp&version=13.12.0
#tool nuget:?package=net.sf.mpxj-for-csharp&version=13.12.0
MPXJ for C#
IMPORTANT: this is the legacy .Net version of MPXJ. When MPXJ 14 is released this package will no longer be published. Please migrate your code to use the MPXJ.Net package instead.
MPXJ is a Java library which allows a variety of project file formats and databases to be read and written. This NuGet package uses IKVM to translate the Java library into a .Net assembly. You can find details of the classes and methods in the Javadocs, and more general documentation on the MPXJ website.
This version is not a direct translation of the original Java library: instead it provides C# properties rather than requiring the use of getter and setter methods, and where possible adjusting method names to being with an uppercase letter to allow more idiomatic C# to be written when using this library.
A version of this assembly is available from NuGet (MPXJ) which is a direct translation of the Java library and another version of the assembly (MPXJ for VB) is also available which is more suited for use with VB.
After installing this package you can either work with some of the simple built-in utilities provided by MPXJ for tasks like file format conversion:
using net.sf.mpxj.sample;
new MpxjConvert().process("example.mpp", "example.mpx");
or you can interact directly with the object model exposed by MPXJ to extract data:
using net.sf.mpxj.reader;
using Task = net.sf.mpxj.Task;
var project = new UniversalProjectReader().read("example.mpp");
System.Console.WriteLine("Tasks");
foreach (Task task in project.Tasks)
{
System.Console.WriteLine(task.ID.toString() + "\t" + task.Name);
}
or finally you can generate your own schedule:
using java.text;
using net.sf.mpxj;
using net.sf.mpxj.writer;
// In the example below we'll be generating an MSPDI
// file which we can import into Microsoft Project.
var filename = "example.xml";
var fileformat = FileFormat.MSPDI;
// Create a simple date format to allow us to easily set date values.
var df = new SimpleDateFormat("dd/MM/yyyy");
// Create a ProjectFile instance
var file = new ProjectFile();
// Add a default calendar called "Standard"
var calendar = file.addDefaultBaseCalendar();
// Add a holiday to the calendar to demonstrate calendar exceptions
calendar.addCalendarException(df.parse("13/03/2006"), df.parse("13/03/2006"));
// Retrieve the project properties and set the start date. Note Microsoft
// Project appears to reset all task dates relative to this date, so this
// date must match the start date of the earliest task for you to see
// the expected results. If this value is not set, it will default to
// today's date.
var properties = file.ProjectProperties;
properties.StartDate = df.parse("01/01/2003");
// Set a couple more properties just for fun
properties.ProjectTitle = "Created by MPXJ";
properties.Author = "Jon Iles";
// Let's create an alias for TEXT1
var customFields = file.CustomFields;
var field = customFields.getOrCreate(TaskField.TEXT1);
field.setAlias("My Custom Field");
// Add resources
var resource1 = file.addResource();
resource1.Name = "Resource1";
var resource2 = file.addResource();
resource2.Name = "Resource2";
resource2.MaxUnits = java.lang.Double.valueOf(50.0);
// Create a summary task
var task1 = file.addTask();
task1.Name = "Summary Task";
// Create the first sub task
var task2 = task1.addTask();
task2.Name = "First Sub Task";
task2.Duration = Duration.getInstance(10.5, TimeUnit.DAYS);
task2.Start = df.parse("01/01/2003");
task2.setText(1, "My Custom Value 1");
// We'll set this task up as being 50% complete. If we have no resource
// assignments for this task, this is enough information for MS Project.
// If we do have resource assignments, the assignment record needs to
// contain the corresponding work and actual work fields set to the
// correct values in order for MS project to mark the task as complete
// or partially complete.
task2.PercentageComplete = java.lang.Double.valueOf(50.0);
task2.ActualStart = df.parse("01/01/2003");
// Create the second sub task
var task3 = task1.addTask();
task3.Name = "Second Sub Task";
task3.Start = df.parse("11/01/2003");
task3.Duration = Duration.getInstance(10, TimeUnit.DAYS);
task3.setText(1, "My Custom Value 2");
// Link these two tasks
task3.addPredecessor(task2, RelationType.FINISH_START, null);
// Add a milestone
var milestone1 = task1.addTask();
milestone1.Name = "Milestone";
milestone1.Start = df.parse("21/01/2003");
milestone1.Duration = Duration.getInstance(0, TimeUnit.DAYS);
milestone1.addPredecessor(task3, RelationType.FINISH_START, null);
// This final task has a percent complete value, but no
// resource assignments. This is an interesting case it it requires
// special processing to generate the MSPDI file correctly.
var task4 = file.addTask();
task4.Name = "Next Task";
task4.Duration = Duration.getInstance(8, TimeUnit.DAYS);
task4.Start= df.parse("01/01/2003");
task4.PercentageComplete = java.lang.Double.valueOf(70.0);
task4.ActualStart = df.parse("01/01/2003");
// Assign resources to tasks
var assignment1 = task2.addResourceAssignment(resource1);
var assignment2 = task3.addResourceAssignment(resource2);
// As the first task is partially complete, and we are adding
// a resource assignment, we must set the work and actual work
// fields in the assignment to appropriate values, or MS Project
// won't recognise the task as being complete or partially complete
assignment1.Work = Duration.getInstance(80, TimeUnit.HOURS);
assignment1.ActualWork = Duration.getInstance(40, TimeUnit.HOURS);
// If we were just generating an MPX file, we would already have enough
// attributes set to create the file correctly. If we want to generate
// an MSPDI file, we must also set the assignment start dates and
// the remaining work attribute. The assignment start dates will normally
// be the same as the task start dates.
assignment1.RemainingWork = Duration.getInstance(40, TimeUnit.HOURS);
assignment2.RemainingWork = Duration.getInstance(80, TimeUnit.HOURS);
assignment1.Start = df.parse("01/01/2003");
assignment2.Start = df.parse("11/01/2003");
// Write a 100% complete task
var task5 = file.addTask();
task5.Name = "Last Task";
task5.Duration = Duration.getInstance(3, TimeUnit.DAYS);
task5.Start = df.parse("01/01/2003");
task5.PercentageComplete = java.lang.Double.valueOf(100.0);
task5.ActualStart = df.parse("01/01/2003");
// Write a 100% complete milestone
var task6 = file.addTask();
task6.Name = "Last Milestone";
task6.Duration = Duration.getInstance(0, TimeUnit.DAYS);
task6.Start = df.parse("01/01/2003");
task6.PercentageComplete = java.lang.Double.valueOf(100.0);
task6.ActualStart = df.parse("01/01/2003");
// Write the file
new UniversalProjectWriter(fileformat).write(file, filename);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.1
- System.Configuration.ConfigurationManager (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on net.sf.mpxj-for-csharp:
Repository | Stars |
---|---|
countincognito/Zametek.ProjectPlan
A simple, Open Source, and cross-platform desktop alternative to Microsoft Project for designing and creating project plans.
|
Version | Downloads | Last updated | |
---|---|---|---|
13.12.0 | 948 | 4/9/2025 | |
13.11.0 | 1,733 | 3/10/2025 | |
13.10.0 | 3,379 | 2/7/2025 | |
13.9.0 | 2,663 | 1/9/2025 | |
13.8.0 | 1,794 | 12/17/2024 | |
13.7.0 | 4,014 | 11/25/2024 | |
13.6.0 | 5,720 | 11/6/2024 | |
13.5.1 | 11,221 | 10/28/2024 | |
13.5.0 | 7,478 | 10/17/2024 | |
13.4.2 | 3,226 | 10/8/2024 | |
13.4.1 | 798 | 10/7/2024 | |
13.4.0 | 4,354 | 9/18/2024 | |
13.3.1 | 4,092 | 8/30/2024 | |
13.3.0 | 1,594 | 8/22/2024 | |
13.2.1 | 4,403 | 8/13/2024 | |
13.2.0 | 2,742 | 8/12/2024 | |
13.1.0 | 16,969 | 7/26/2024 | |
13.0.2 | 3,863 | 7/8/2024 | |
13.0.1 | 991 | 7/4/2024 | |
13.0.0 | 3,288 | 6/20/2024 | |
12.10.3 | 1,331 | 6/14/2024 | |
12.10.2 | 1,722 | 6/3/2024 | |
12.10.1 | 1,896 | 5/22/2024 | |
12.10.0 | 3,835 | 5/13/2024 | |
12.9.3 | 3,569 | 4/24/2024 | |
12.9.2 | 3,251 | 4/19/2024 | |
12.9.1 | 4,995 | 4/17/2024 | |
12.9.0 | 2,787 | 4/11/2024 | |
12.8.1 | 5,079 | 3/11/2024 | |
12.8.0 | 4,539 | 3/4/2024 | |
12.7.0 | 9,887 | 2/7/2024 | |
12.6.0 | 5,921 | 1/22/2024 | |
12.5.0 | 7,294 | 12/18/2023 | |
12.4.0 | 6,485 | 11/23/2023 | |
12.3.0 | 6,501 | 11/7/2023 | |
12.2.0 | 7,240 | 10/12/2023 | |
12.1.3 | 6,250 | 9/25/2023 | |
12.1.2 | 6,625 | 9/21/2023 | |
12.1.1 | 6,738 | 8/23/2023 | |
12.1.0 | 7,162 | 8/22/2023 | |
12.0.2 | 10,096 | 7/25/2023 | |
12.0.1 | 8,774 | 7/21/2023 | |
12.0.0 | 11,884 | 6/29/2023 | |
11.5.4 | 15,513 | 6/27/2023 | |
11.5.3 | 8,929 | 6/19/2023 | |
11.5.2 | 9,985 | 6/8/2023 | |
11.5.1 | 9,193 | 5/24/2023 | |
11.5.0 | 6,862 | 5/19/2023 | |
11.4.0 | 7,156 | 5/8/2023 | |
11.3.2 | 7,490 | 4/29/2023 | |
11.3.1 | 6,164 | 4/21/2023 | |
11.3.0 | 12,516 | 4/12/2023 | |
11.2.0 | 19,118 | 3/13/2023 | |
11.1.0 | 8,749 | 2/15/2023 | |
11.0.0 | 1,377 | 2/8/2023 | |
10.16.2 | 1,723 | 1/29/2023 | |
10.16.1 | 1,320 | 1/26/2023 | |
10.16.0 | 1,316 | 1/24/2023 | |
10.15.0 | 1,478 | 1/11/2023 | |
10.14.1 | 7,026 | 11/25/2022 | |
10.14.0 | 3,117 | 11/21/2022 | |
10.13.0 | 1,825 | 11/16/2022 | |
10.12.0 | 1,637 | 11/1/2022 | |
10.11.0 | 6,142 | 9/27/2022 | |
10.10.0 | 1,622 | 9/13/2022 | |
10.9.1 | 2,129 | 8/31/2022 | |
10.9.0 | 1,628 | 8/23/2022 | |
10.8.0 | 1,637 | 8/17/2022 | |
10.7.0 | 10,074 | 8/9/2022 | |
10.6.2 | 4,436 | 6/29/2022 | |
10.6.1 | 2,527 | 6/14/2022 | |
10.6.0 | 1,934 | 6/8/2022 | |
10.5.0 | 1,736 | 5/24/2022 | |
10.4.0 | 2,213 | 5/9/2022 | |
10.3.0 | 1,688 | 4/29/2022 | |
10.2.0 | 3,256 | 3/6/2022 | |
10.1.0 | 2,121 | 1/29/2022 | |
10.0.5 | 3,815 | 1/11/2022 | |
10.0.4 | 1,554 | 1/7/2022 | |
10.0.3 | 1,674 | 12/22/2021 | |
10.0.2 | 1,620 | 12/16/2021 | |
10.0.1 | 1,586 | 12/10/2021 | |
10.0.0 | 3,369 | 12/1/2021 | |
9.8.3 | 1,895 | 11/30/2021 | |
9.8.2 | 2,314 | 11/1/2021 | |
9.8.1 | 1,944 | 10/13/2021 | |
9.8.0 | 2,044 | 9/30/2021 | |
9.7.0 | 1,614 | 9/28/2021 | |
9.6.0 | 1,683 | 9/13/2021 | |
9.5.2 | 1,691 | 8/22/2021 | |
9.5.1 | 1,842 | 7/2/2021 | |
9.5.0 | 1,727 | 6/30/2021 | |
9.4.0 | 1,862 | 6/11/2021 | |
9.3.1 | 16,597 | 5/18/2021 | |
9.3.0 | 1,732 | 5/6/2021 | |
9.2.6 | 2,885 | 4/26/2021 | |
9.2.5 | 1,724 | 4/20/2021 | |
9.2.4 | 1,763 | 4/9/2021 | |
9.2.3 | 1,672 | 4/8/2021 | |
9.2.2 | 1,653 | 4/7/2021 | |
9.2.1 | 1,707 | 4/4/2021 | |
9.2.0 | 1,695 | 3/30/2021 | |
9.1.0 | 2,025 | 3/11/2021 | |
9.0.0 | 2,371 | 2/18/2021 | |
8.5.1 | 5,035 | 1/8/2021 | |
8.5.0 | 1,839 | 1/6/2021 | |
8.4.0 | 1,816 | 12/29/2020 | |
8.3.5 | 1,947 | 12/15/2020 | |
8.3.4 | 1,914 | 12/10/2020 | |
8.3.3 | 1,924 | 11/24/2020 | |
8.3.2 | 2,181 | 10/22/2020 | |
8.3.1 | 1,980 | 10/14/2020 | |
8.3.0 | 1,977 | 10/13/2020 | |
8.2.0 | 2,291 | 9/9/2020 | |
8.1.4 | 1,859 | 8/31/2020 | |
8.1.3 | 9,684 | 6/25/2020 | |
8.1.2 | 1,903 | 6/18/2020 | |
8.1.1 | 1,944 | 6/17/2020 | |
8.1.0 | 2,244 | 6/11/2020 | |
8.0.8 | 2,393 | 4/20/2020 | |
8.0.6 | 2,383 | 3/5/2020 | |
8.0.5 | 2,417 | 2/7/2020 | |
8.0.4 | 1,927 | 2/6/2020 | |
8.0.3 | 2,405 | 1/27/2020 | |
8.0.2 | 1,900 | 1/16/2020 | |
8.0.1 | 5,955 | 1/5/2020 | |
8.0.0 | 1,978 | 1/2/2020 | |
7.9.8 | 2,031 | 12/27/2019 | |
7.9.7 | 2,089 | 11/25/2019 | |
7.9.5 | 1,903 | 11/19/2019 | |
7.9.4 | 1,924 | 11/8/2019 | |
7.9.3 | 2,903 | 9/10/2019 | |
7.9.2 | 2,224 | 8/19/2019 | |
7.9.1 | 3,138 | 7/1/2019 | |
7.9.0 | 1,979 | 7/1/2019 | |
7.8.4 | 1,930 | 6/27/2019 | |
7.8.3 | 2,304 | 5/24/2019 | |
7.8.2 | 2,048 | 5/19/2019 | |
7.8.1 | 6,554 | 2/13/2019 | |
7.8.0 | 2,777 | 1/18/2019 | |
7.7.1 | 4,577 | 10/23/2018 | |
7.7.0 | 2,227 | 10/12/2018 | |
7.6.3 | 2,230 | 10/4/2018 | |
7.6.2 | 2,724 | 8/30/2018 | |
7.6.1 | 2,251 | 8/29/2018 | |
7.6.0 | 2,724 | 7/13/2018 | |
7.5.0 | 2,880 | 6/19/2018 | |
7.4.4 | 2,543 | 6/6/2018 | |
7.4.3 | 2,597 | 5/25/2018 | |
7.4.2 | 2,753 | 4/30/2018 | |
7.4.1 | 2,623 | 4/16/2018 | |
7.4.0 | 2,726 | 3/23/2018 | |
7.3.0 | 2,575 | 3/12/2018 | |
7.2.1 | 3,247 | 1/26/2018 | |
7.2.0 | 2,500 | 1/18/2018 | |
7.1.0 | 2,515 | 1/3/2018 | |
7.0.3 | 2,541 | 12/21/2017 | |
7.0.2 | 2,483 | 11/20/2017 | |
7.0.1 | 2,407 | 11/20/2017 | |
7.0.0 | 2,415 | 11/8/2017 | |
6.2.1 | 4,037 | 10/11/2017 | |
6.2.0 | 2,389 | 10/6/2017 | |
6.1.2 | 2,506 | 9/12/2017 | |
6.1.0 | 2,852 | 7/28/2017 | |
6.0.0 | 2,469 | 7/22/2017 | |
5.14.0 | 2,629 | 7/13/2017 | |
5.13.0 | 2,506 | 6/27/2017 | |
5.12.0 | 2,440 | 6/26/2017 | |
5.11.0 | 2,517 | 6/20/2017 | |
5.10.0 | 2,523 | 5/23/2017 | |
5.9.0 | 2,580 | 4/27/2017 | |
5.8.0 | 2,520 | 4/21/2017 | |
5.7.1 | 2,561 | 3/22/2017 | |
5.7.0 | 2,453 | 3/20/2017 | |
5.6.5 | 2,491 | 3/7/2017 | |
5.6.4 | 8,448 | 2/16/2017 | |
5.6.3 | 2,435 | 2/8/2017 | |
5.6.2 | 2,489 | 2/6/2017 | |
5.6.1 | 2,427 | 2/3/2017 | |
5.6.0 | 2,456 | 1/29/2017 | |
5.5.9 | 2,488 | 1/27/2017 | |
5.5.8 | 2,454 | 1/23/2017 | |
5.5.7 | 2,446 | 1/13/2017 | |
5.5.6 | 2,507 | 1/6/2017 | |
5.5.5 | 2,490 | 1/6/2017 | |
5.5.4 | 2,626 | 12/1/2016 | |
5.5.3 | 2,458 | 11/29/2016 | |
5.5.2 | 2,991 | 11/2/2016 | |
5.5.1 | 2,605 | 10/14/2016 | |
5.5.0 | 2,443 | 10/13/2016 | |
5.4.0 | 2,443 | 10/6/2016 | |
5.3.3 | 2,666 | 8/31/2016 | |
5.3.2 | 2,468 | 8/31/2016 | |
5.3.1 | 2,597 | 7/1/2016 | |
5.3.0 | 2,617 | 6/10/2016 | |
5.2.2 | 4,756 | 3/11/2016 | |
5.2.1 | 4,342 | 2/11/2016 | |
5.2.0 | 3,767 | 2/8/2016 | |
5.1.18 | 4,242 | 1/26/2016 | |
5.1.17 | 4,661 | 12/30/2015 | |
5.1.16 | 4,774 | 12/18/2015 | |
5.1.15 | 3,870 | 12/16/2015 | |
5.1.13 | 4,089 | 11/26/2015 | |
5.1.12 | 3,902 | 11/16/2015 | |
5.1.11 | 3,685 | 11/12/2015 | |
5.1.10 | 4,841 | 9/9/2015 | |
5.1.9 | 3,898 | 8/30/2015 | |
5.1.5 | 4,378 | 6/5/2015 | |
5.1.4 | 3,190 | 6/3/2015 | |
5.1.0 | 3,585 | 5/18/2015 | |
5.0.0 | 3,265 | 5/6/2015 | |
4.7.6 | 4,172 | 3/18/2015 | |
4.7.5 | 3,317 | 2/27/2015 | |
4.7.4 | 3,634 | 2/25/2015 | |
4.7.3 | 3,715 | 12/23/2014 | |
4.7.1 | 3,391 | 12/8/2014 | |
4.7.0 | 3,528 | 12/4/2014 | |
4.6.2 | 3,906 | 11/11/2014 | |
4.6.1 | 3,577 | 10/17/2014 |