Microsoft.IdentityModel dll gets installed by installing an update from here. It is not guaranteed that all the machines running Windows have this update installed and when you want to distribute an application via ClickOnce deployment, it becomes necessary to check if the target machine has Microsoft.IdentityModel available in GAC before installing your software.
The problem we are trying to solve is - how to add "Windows Identity Foundation" as a custom pre-requisite for your ClickOnce deployment".
Here is how you would go to the list of prerequisites in a ClickOnce deployment definition:

By default, you only see a list of prerequisites you could choose from in the standard prerequisites dialog in Visual Studio:

The following explanation walks you through the steps to be performed to get "Windows Identity Foundation" as one of the prerequisites that you can choose from in the list (ref. above screenshot).
- Download Bootstrapper Manifest Generator http://archive.msdn.microsoft.com/bmg
- Install Bootstrapper Manifest Generator
- Open BMG (Bootstrapper Manifest Generator) you will see the following screen.
- Select File -> New and the following screen appears

- Select Package Manifest and click on OK

- Type Project name and click on "Add Installer" icon (icon on the top-left)

- Browse for the windows update file and click OK

- Fill the properties (tabs) - System Checks, Install conditions and Exit Codes as illustrated in the following screenshots




