> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/core/get-started/faq/dotnet-fileload-exception.md).

# "FileLoadException" or "FileNotFoundException" on .NET/WPF

World's #1 PDF SDK Library for Web, Mobile, Server, Desktop

## Resolving FileLoadException due to missing VC redistributable

Starting with PDFNet 10.1 the [VC++ v14](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist) redistributable is needed.

For PDFNet versions 7.1 - 10.0 the [VC++ 2013](https://www.microsoft.com/en-us/download/details.aspx?id=40784) runtimes are needed. Earlier versions of PDFNet use the [VC++ 2010](https://www.microsoft.com/en-us/download/details.aspx?id=13523) runtime.

With versions of Visual Studio since 2008, Microsoft no longer allows statically linking to the CRT for .NET components. To get everything working, installing the VC++ runtime is not necessary, instead required DLLs can simply be copied into the same folder where PDFNet.DLL is located. There is no dll registration needed.

See this [Microsoft guide](https://docs.microsoft.com/en-us/cpp/windows/redistributing-visual-cpp-files?view=msvc-160#locate-the-redistributable-files) on deployment options for the VC++ runtime redistributables.

If in doubt when using an older version, a utility called [Dependency Walker](http://www.dependencywalker.com/) can help you to identify which two DLLs are required.

## "Could not load file or assembly 'PDFNet.dll'" when using PDFNet for .NET 4.x

This issue is most likely caused by missing VC++ Runtime redistributables, which can either be installed on the OS, or packaged with your app.

See above for links to correct VC++ runtime.

If there is some still some reason your require using .NET 2 assembly, the following article might help. [http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4](http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4/)

## Unable to load DLL PDFNet.dll or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)

This error generally means that GDI+ is missing/blocked by your OS, e.g. Windows Nano Server. PDFNet on Windows requires GDI+ for loading fonts, so to resolve this issue please upgrade to a server environment that allows access to GDI+.

For **Azure Function** the default settings block GDI+, but it is possible to reconfigure Azure Function to work. For example, one possible solution is to change the Function App hosting plan from "Serverless Consumption Plan" to the "App Service Plan" with a Basic server, for instance. Azure support should be able to assist you in getting GDI+. Or alterntively, switch to Linux based Azure Function.

## Resolving 'FileNotFoundException: Could not load file or assembly 'PDFNet.dll' or one of its dependencies' \[64-bit and .NET 4 specific]

If you are using a direct reference to `PDFNet.dll`, please ensure that your reference is pointing to the correct version `32-bit vs 64-bit` of the `PDFNet dll`. Also check and ensure that `copylocal` is set to true for the assembly reference in the project.

Or see the guides above to make sure you have the required VC++ and GDI dependencies.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/core/get-started/faq/dotnet-fileload-exception.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
