> 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/iis-servers.md).

# IIS server exceptions

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

You may encounter `BadImageFormatException, incorrect format` exceptions when using PDFNet on IIS. One possible cause can be that you need to match the IIS `Enable 32-bit application` setting to which version of PDFNet (32 or 64 bit) that you are using.

In the case of IIS 2008 R2 Web Server application pool, set the Identity to "LocalSystem" (for both .NET 2.0 and .NET 4.0). Also, make sure to set the "Enable 32-Bit Applications" to "True".

Latest versions of Visual Studio now include 64bit IIS. You can set this by going to Tools -> Options -> Project and Solutions -> Web Projects and checking "Use the 64 bit version of IIS Express".

Finally, be aware that different versions of IIS default to different versions of the `.NET Framework`, so you may need to match that with the version of PDFNet you are using (.NET 2 or 4).

## Using the demo version with IIS

If you are trying to run your demo on an IIS server, you can change the Application Pool’s identity to a User Account with read/write access to the registry.

1. Go to IIS Manager, select the web server, and then Application Pools.
2. Click on the Application Pool you are using from the list, then on the Actions panel, under Edit Application Pool, click Advanced Settings...
3. In the Advanced Settings dialog, go to the Process Model section and click on the Identity to change it.
4. Once the Application Pool Identity dialog shows up, select Custom account:, then click Set...
5. Enter the user account information in the Set Credentials dialog box. Note: you may have to specify the domain of the user (i.e. MyServerDomain\MyUserAccount).
6. Click OK until all dialog boxes are closed.

See [Forum: How do I resolve 'BadImageFormatException' when using 64-bit version of PDFNet for .NET?](https://groups.google.com/forum/?fromgroups#!searchin/pdfnet-sdk/iis$20default$2032/pdfnet-sdk/Op5m-2VH2ww/OkkQHysZWHgJ) for more information.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/core/get-started/faq/iis-servers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
