When installing a .net application on terminal server, this exception is thrown when starting the app :
System.Configuration.ConfigurationErrorsExceptionMessage = Index 1 is out of range.FullText=
System.Configuration.ConfigurationErrorsException: Index 1 is out of range.
at System.Configuration.ConfigurationElementCollection.BaseGet(Int32 index)
at System.Configuration.ConnectionStringSettingsCollection.get_Item(Int32 index)
The connection string, which is in AppName.exe.config, can not be found. However, the config file is placed at the correct location, next to the .exe file, and the connection string is present in the .config file. This error only happens on terminal server, on XP, Vista, win7 everything runs fine ...
Appname.exe.config :
<?xml version="1.0"?>
<configuration>
<configSections>
...
</configSections>
<connectionStrings>
<add name="..."
connectionString="..." />
<add name="..."
connectionString="..." />
</connectionStrings>
...
What's going on ??
As you probably also found out, the error you get is related to the application not being able to read/write from your xml file.
I faced a similar issue when running an application in a citrix client and on a terminal server, the app itself ran fine from a client OS and a VHD.
As for troubleshooting this, I would suggest the following..
All of the above steps are related to rights as this was the issue with my app. But ofcourse that is just one way to start troubleshooting it.. hope this helps.