Revit 2026 API - RevitAddinUtility - Manifest Settings omitted when SaveAs()

Revit 2026 API - RevitAddinUtility - Manifest Settings omitted when SaveAs()

I'm looking to utilize the new add-in dependency isolation tools in the Revit 2026 API. When I make my addin manifest manually, Revit loads my addin in its own context as expected. Overall this feature seems to be working great.

My question comes when trying to utilize the RevitAddinUtility RevitAddInManifest class to construct and save my addin manifest as part of a custom installer. How can I get the RevitAddin.SaveAs() method to print the ManifestSettings?

Previous versions of our installer have used this pattern without issue:

var manifest = new RevitAddInManifest();

manifest.AddInApplications.Add(new RevitAddInApplication( ...my properties... ));
manifest.AddInCommands.Add(new RevitAddInCommand( ...my properties... ));

manifest.SaveAs(manifestPath);

But if I try to add the ManifestSettings, it allows me to set the ManifestSettings properties, but does not write the ManifestSettings section in the file written by SaveAs().

My updated code looks like this:

var manifest = new RevitAddInManifest();

manifest.AddInApplications.Add(new RevitAddInApplication( ...my properties... ));
manifest.AddInCommands.Add(new RevitAddInCommand( ...my properties... ));

if (addManifestSettings)
{
    // RevitAddin.ManifestSettings is read-only, so I can't make use of "new RevitAddinManifestSettings()".    
    manifest.ManifestSettings.UseRevitContext = false;

    if (!string.IsNullOrWhiteSpace(contextName))
    {
        manifest.ManifestSettings.ContextName = contextName;
    }
}

manifest.SaveAs(manifestPath);

Current output example:

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Application">
    <Name>MyProject Application</Name>
    <Assembly>C:\Path\MyProject.dll</Assembly>
    <AddInId>some guid</AddInId>
    <FullClassName>MyProject.App</FullClassName>
    <VendorId>My company</VendorId>
    <VendorDescription>My company with web url</VendorDescription>
  </AddIn>
</RevitAddIns>

Desired output example:

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Application">
    <Name>MyProject Application</Name>
    <Assembly>C:\Path\MyProject.dll</Assembly>
    <AddInId>some guid</AddInId>
    <FullClassName>MyProject.App</FullClassName>
    <VendorId>My company</VendorId>
    <VendorDescription>My company with web url</VendorDescription>
  </AddIn>
  <ManifestSettings>
    <UseRevitContext>False</UseRevitContext>
    <ContextName>MyCompany.MyProject</ContextName>
  </ManifestSettings>
</RevitAddIns>

Answer

Get the latest RevitAddinUtility.dll

I was using RevitAddinUtility.dll version 26.0.10.8 when I wrote up this question. Before I hit 'post' I realized I did not have the latest version of Revit 2026. I'm now using RevitAddinUtility.dll version 26.1.0.35, and the ManifestSettings save as expected.

The example code above may be useful to others, so I decided to go ahead and post this as a Q&A.

Enjoyed this question?

Check out more content on our blog or follow us on social media.

Browse more questions