Skip to content
samatrhea edited this page Oct 18, 2026 · 1 revision

Reading

ArgumentException: only .reqif, .reqifz and .zip are supported file extensions

The Deserialize(string fileUri) overload picks the format from the file extension, and the check is case-sensitive: Export.REQIF is rejected. Rename the file, or open it as a stream and pass the format:

using var stream = File.OpenRead("Export.REQIF");
var reqifs = new ReqIFDeserializer().Deserialize(stream, SupportedFileExtensionKind.Reqif);

ArgumentException: validationEventHandler must be null when validate is false

You passed a validation handler but left validation off. Pass validate: true as well, or remove the handler.

XmlSchemaValidationException when reading

You turned on validation without a handler, and the document doesn't follow the ReqIF schema. Pass a handler to collect all problems and still get the document, or turn validation off. Many tools export files that are not strictly valid; ReqIFSharp reads most of them without validation. See Reading ReqIF.

FileNotFoundException: No reqif file could be found in the archive

The .reqifz or .zip contains no file that ends with .reqif. Open the archive with a zip tool to check what it contains.

Reading from an HTTP response or upload stream fails

The deserializer and the ReqIFLoaderService rewind the stream to its start, which needs a seekable stream. Copy the stream into a MemoryStream first, see Reading ReqIF.

The text of a requirement is full of <xhtml:div> tags

Rich text attributes hold XHTML. Use ExtractUnformattedTextFromValue() on the AttributeValueXHTML for plain text, or render TheValue as HTML. QueryFormattedValue() from ReqIFSharp.Extensions returns the markup unchanged.

Some content is skipped and I see warnings like The ... element at line:position ... is not supported

ReqIFSharp logs a warning for XML it does not recognize at that position, and continues. Pass an ILoggerFactory to the deserializer to see these warnings, see Reading ReqIF. If the element is valid ReqIF, please open an issue and attach a small sample file.

Where are the images of my requirements?

In the XHTML attribute values, as ExternalObjects. In a .reqifz archive the image files sit next to the ReqIF document. See Reading ReqIF or the loader service.

How do I find the "ID" or "Text" of a requirement?

ReqIF has no fixed attribute names: every tool defines its own spec types and attributes. Look at reqif.CoreContent.SpecTypes in a sample export, or open it in the ReqIF Viewer, to see which names your tool uses. Many tools follow the ReqIF Implementation Guide and use ReqIF.ForeignID, ReqIF.Text and ReqIF.ChapterName.

Writing

Another tool rejects the file I wrote

Read your file back with validation turned on; the problems it lists are usually the cause:

new ReqIFDeserializer().Deserialize("output.reqif", true, (sender, e) => Console.WriteLine(e.Message));

The usual causes are an identifier that starts with a digit (such as a bare GUID), a missing LastChange, an enumeration literal without Properties, or a datatype or type that is used but not added to CoreContent. See the tips in Writing ReqIF.

InvalidOperationException: The owning ReqIFContent of the SpecObjectType is not set

An extension method from ReqIFSharp.Extensions needs to find related elements through the ReqIFContent property. Set it on the elements you built yourself, for example specObjectType.ReqIFContent = content;.

Can I write several documents to one file?

Yes, to a .reqifz or .zip archive: pass all ReqIF objects to Serialize. A .reqif file holds exactly one document.

Packages and platforms

Which .NET versions are supported?

Both packages target netstandard2.0: .NET Framework 4.6.2 and later, and .NET Core 2.0 and later, including .NET 6, 8 and 10. Building ReqIFSharp itself from source needs the .NET 10 SDK.

Why does ReqIFSharp depend on an old version of Microsoft.Extensions.Logging.Abstractions?

It doesn't force an old version. 6.0.0 is the minimum; NuGet uses the version your application references when that is newer. The low minimum keeps ReqIFSharp usable from older applications. See Dependencies in the README.

Which versions of ReqIFSharp and ReqIFSharp.Extensions go together?

Each release of ReqIFSharp.Extensions depends on the ReqIFSharp release it was built with. The CHANGELOG lists both versions for every release. Installing ReqIFSharp.Extensions also installs a matching ReqIFSharp.

Which version of ReqIF is supported?

ReqIF 1.0.1, 1.1 and 1.2. They share the same XML schema and namespace, http://www.omg.org/spec/ReqIF/20110401/reqif.xsd.

How do I cite ReqIFSharp?

The repository contains a CITATION.cff. GitHub shows a "Cite this repository" button based on it.

Clone this wiki locally