SymptomsWhen end users attempt to access the Forefront UAG portal, they may receive the following message "An unexpected error occurred when starting the application." There may also be an event 158 in the event viewer or in the Web Monitor with the description "ADFSv2Site: The application settings could not be read because the trunk name is not defined."

Cause—The web.config file for this portal has been modified and does not define the trunk name in the application settings.

Solution—Either activate the configuration to recreate the web.config file, or manually modify the web.config file as follows:

  1. On the Forefront UAG server, go to ...\Microsoft Forefront Unified Access Gateway\von\InternalSite\ADFSv2Sites\<trunk_name>\ and open the web.config file.
  2. In the <appSettings> section, add the following line:

<add key="TrunkName" value="[trunk name]">

where [trunk name] is the name of the HTTPS trunk in the Forefront UAG Management console.