How to: Restore a Missing Web.config File
If you cannot access a Web service, the Web.config file for that service might be missing because it was moved, renamed, or deleted. Web.config files contain configuration settings for Visual Studio Team System Team Foundation Server. For an overview of these settings, see Managing Configuration Settings for Team Foundation Server.
If you suspect that a Web.config file is missing, search for it in the Web Services directory and subdirectories. For information about where Web.config files are stored, see How to: Change Configuration Settings for Team Foundation Server Components. If a Web.config file is missing, you must restore it to work with your current deployment configuration.
Important Note: |
---|
Do not use the ASP.NET tab of the Internet Information Services (IIS) Manager (inetmgr) (version 6.0) to modify a configuration file. If you use this tab, the system adds an attribute to the <configuration> element of the file. This attribute interferes with normal functioning. |
Required Permissions
To perform these procedures, you must be a member of the Administrators security group on the application-tier server for Team Foundation.
To restore a missing Web.config file
Log on to the application-tier server.
Open Windows Explorer, open the installation directory for Team Foundation Server, and locate the Web.config file for each Web service as the following table describes:
Web site or service
Location of Web.config file
Team Foundation Server Web site
Root Web Services directory
Team Foundation services
Services subdirectory
Team Foundation build service
Build subdirectory
Version control service
VersionControl subdirectory
Work item tracking service
WorkItemTracking subdirectory
If a Web.config file is in the appropriate directory but is not named Web.config, rename the file to Web.config.
If the directory does not contain a Web.config file, restore it from the installation source for Team Foundation Server.
These files are located in the subdirectories under the AT directory. For Team System 2008 Team Foundation Server, open the \AT\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services directory.
Locate the Web.config file for the Web site or virtual directory whose configuration file is missing.
Copy the Web.config to the corresponding directory on the application-tier server.
If you restored the global Web services file (the Web.config file in the root Web Services directory), modify the file to support your deployment configuration:
In a text or XML editor, open the Web.Config file that you copied to the Drive:\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services directory.
Note
Even if you are logged on with administrative credentials, you must open Notepad as an administrator to perform this function on a server that is running Windows Server 2008. To open Notepad as an administrator, click Start, right-click Command Prompt, and click Run as administrator. For more information, see the Microsoft Web site.
Change the value of the following elements to reflect your deployment:
<add key="TFSNameUrl" value="http://TFSAppTierServer:8080" /> <add key="TFS Name" value="TFSAppTierServer"/> <add key="TFSUrlPublic" value="https://www.TFSURLPublic.com:8081"/>
For more information, see Global Web.Config File Settings in Team Foundation Server Components.
Save and close the file.
If you restore the Services Web.config file, modify the file to support your deployment configuration:
In a text or XML editor, open the Web.Config file that you copied to the Drive\%Program Files%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services directory.
Change the value of the following elements to reflect your deployment:
<add key="ConnectionString" value="Application Name=TeamFoundation;Persist Security Info=False;Initial Catalog=TfsIntegration;Data Source=TFSDataTier;Integrated Security=SSPI"/> <add key="eventingEnabled" value="true" /> <add key="emailNotificationFromAddress" value="TFSService@domain" /> <add key="smtpServer" value="TFSSMTPServer" />
For more information, see Services Web.Config File Settings in Team Foundation Server Components.
Save and close the file.
Modify any other Web.config files that support customizations that you made to the deployment.
For more information, see Managing Configuration Settings for Team Foundation Server.
Restart the Web services for your changes to take effect.
On the application-tier server, click Start, point to Administrative Tools, and then click Services.
Right-click World Wide Web Publishing Service (W3SVC), and then click Restart.
See Also
Tasks
How to: Change Configuration Settings for Team Foundation Server Components
Resolving Problems Accessing Web Services
Concepts
Global Web.Config File Settings in Team Foundation Server Components
Services Web.Config File Settings in Team Foundation Server Components