Resolving Microsoft.DotNet.PlatformAbstractions.dll Exception in Azure Functions
📝Context
After the Azure Functions In-Process Runtime was updated to version 4.838.200.25164, developers deploying iText with .NET projects may encounter a runtime error related to a missing or unresolved dependency :
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.PlatformAbstractions, Version=1.1.0.0'
This article outlines the cause and provides a simple workaround to ensure your deployment includes the missing assembly.
📌Cause
iText Core transitively references Microsoft.DotNet.PlatformAbstractions.dll >= 1.1.0, which is now marked as deprecated. As of Azure Functions runtime version 4.838.200.25164, deprecated transitive dependencies are excluded from the published output unless explicitly referenced in your project.
Because of this behavior change, if Microsoft.DotNet.PlatformAbstractions.dll is not declared directly, it may be missing from the /publish directory. This can result in a FileNotFoundException
at runtime, even if the project builds successfully.
✅ Solution
To ensure the dependency is included at publish time, manually add a top-level reference to the NuGet package in the .csproj
file of your project.
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="5.0.0-preview.5.20278.1" />
</ItemGroup>
We recommend using version 5.0.0-preview.5.20278.1
— the latest version at the time of writing. Our testing has confirmed this version is compatible and works with iText.
Additional Notes
This issue is specific to the in-process model of Azure Functions. It does not occur in the isolated-process model (which runs as a standalone app).
For .NET 6, 7, and 8 projects: this issue may persist in Azure Functions deployments unless explicitly overridden as shown.