I can't access app.config from my web test plug in

Problem:  I want to read the connection strings from my app.config of my Web Test Project but it never loads.  Solution:  Use the Configuration Manager OpenMappedExeConfiguration call to load the app.config file.  Code:  // Map the new configuration file.ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();configFileMap.ExeConfigFilename =   System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name + ".config"; // Get the mapped configuration filevar config = ConfigurationManager.OpenMappedExeConfiguration(   configFileMap, ConfigurationUserLevel.None); Explanation: The app.config of the test project is not loaded for web or load tests, because they are run in the same application domain as the test process (either vstesthost.exe or qtagent.exe), so they will load their config files instead. Therefore, we simply load the configuration file ourselves. Loading a configuration file is a two phased process.  First we build a ExcConfigurationFileMap object and set the name of our configuration file to be loaded. Then we open that file with a call to OpenMappedExeConfiguration method of the ConfigurationManager class. I am not a fan of hard coded values so we are going to get the name of the assembly using reflection and simply concatenate ".config" to the end of it.  Calling System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name will return the name of the assembly. After calling OpenMappedExeConfiguration you can use the returned object to access the connection strings or any other data from the app.config.

I want xml transforms to happen on build instead of only publish.

Problem: I have xml transforms I want to preform on build not only on publish. I also want an easy way to transform my config files during my team build.  Finally I want to use it on app.configs in WPF applications as well. Solution: Use SlowCheetah XML Transforms package.  You can install it from the Extension Manager in Visual Studio.  Explanation: SlowCheetah enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.  http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5