I have a c# assembly that uses the app.config to store its database connection string. When debugging the application I noticed that the connection to the database kept fail
You should be getting your connection string by NAME instead of INDEX - that will ensure you're getting what you're asking for.
Try
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["VersionConnectionString"].ConnectionString);