Microsoft KB Archive/167661

= PRB: Visual InterDev Cannot Connect to PWS or Share =

Article ID: 167661

Article Last Modified on 6/16/2006

-

APPLIES TO


 * Microsoft Visual InterDev 1.0 Standard Edition
 * Microsoft Visual InterDev 6.0 Standard Edition
 * Microsoft Personal Web Server 4.0
 * Microsoft Peer Web Services 3.0

-



This article was previously published under Q167661





SYMPTOMS
When using Personal Web Server (for Windows 95) or Peer Web Services (for Windows NT 4.0 Workstation) on a computer that does not have an active network connection, Visual InterDev may be unable to access documents shared using HTTP or FTP.

NOTE: When referring to both Personal Web Server and Peer Web Services throughout this article, the term "Web Server" will be used; if a distinction is needed, then their respective names will be used.

Typical scenarios when using Visual InterDev are as follows:

 When attempting to create a web project, Visual InterDev is unable to locate the server and returns the error message:

Unable to connect to the server (HTTP Error 500)

 When attempting to use the Sample Application Wizard to create a sample project, Visual InterDev prompts the user (step 4 of 5) for a valid UNC path ("\\yourmachinename\sharename") for a shared directory in which to copy the database file. Visual InterDev is unable to locate the shared directory and returns the error message:

\\machinename\sharename does not exist or is read only, please enter a new \\server\share





CAUSE
As noted in the documentation for both Personal Web Server (Windows 95) and Peer Web Services for Windows NT 4.0 Workstation, the Web Server needs to have an active connection to the Internet to enable Domain Name Resolution. If the computer does not have an active connection to the Internet, it must be connected to an Internet Service Provider (ISP) by using Dial-Up Networking.

When Visual InterDev tries to connect to the Web Server using the local computer name, the TCP/IP stack is initialized and attempts to find the computer name. However, it is unable to find the computer name because there is no DNS or WINS service to resolve the Host name to an IP address. Host names are used in virtually all TCP/IP environments and always correspond to an IP address that is stored in a HOSTS file or on a DNS or a WINS server.



RESOLUTION
NOTE: The following workarounds will not work in all cases due to the complexity and possible variations in Network configurations for any given machine. Therefore, consult the appropriate documentation for your operating system or your Network Administrator or contact Windows 95 Networking customer support.

Possible workarounds are listed below.

Workaround 1
Because the Web Server requires an active network connection, one solution is to connect to an Internet Service Provider (ISP) before attempting to view documents shared on the Web Server. This resolves the problem because the ISP provides the Domain Name Resolution service that the Web Server requires.

Workaround 2
If Microsoft Internet Explorer version 3.01 or later is being used, connect to http://localhost. This initializes the TCP/IP stack and connects the browser to the home page on the local computer. The browser will then be able to access documents shared on the Web Server using the computer name instead of "localhost." If Internet Explorer is closed, the above steps must be repeated to access documents shared on the Web Server.

Workaround 3
Use the HOSTS file to resolve the local machine name to the default IP Loopback address (127.0.0.1). The HOSTS file is used as a local Domain Name System (DNS) equivalent to resolve host names to IP addresses. The "Hosts.sam" file, located in the Windows directory (or the WinNT\System32\Drivers\Etc directory for Windows NT Workstation and NT Server), shows an example of the entries that need to be made and can be used as a template. To edit the "Hosts.sam" file, open it in Notepad and replace word "Localhost" with the local machine's name. Because entries are case-sensitive, it is a good idea to assign multiple host names with different cases using the same IP address. Assuming the local machine's name is "Nikichan," an example of the edited "Hosts.sam" file is listed below.

After editing the HOSTS file, save it as "Hosts.txt" (by default, Notepad appends the .txt extension to all files that it saves, including file names without an extension), and then rename it to "Hosts" without the .txt file extension using the Windows Explorer. (To confirm that it is an extension- less file, go into click Options from the View menu, select the "Show all files" option, and deselect "Hide file extensions for known file types.") Reboot the machine so changes will take effect and load the HOSTS file into memory. Visual InterDev should now be able to access documents on Personal Web Server and documents in shared directories.

======================= Example Hosts.sam =====================

# Copyright (c) 1994 Microsoft Corp.  # # This is a sample HOSTS file used by Microsoft TCP/IP for Chicago #  # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. #  # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. #  # For example: #  #      102.54.94.97     rhino.acme.com          # source server #      38.25.63.10     x.acme.com              # x client host

127.0.0.1  Nikichan 127.0.0.1  nikichan ================================================================



STATUS
This behavior is by design.



MORE INFORMATION
The information in this article also applies to the following:


 * Microsoft Personal Web Server version 1.0a or later for Windows 95.
 * Microsoft Peer Web Services version for Windows NT Workstation.
 * Internet Explorer: Version 3.01 (build 4.70.1215) or later.

This article assumes that Visual InterDev and either Personal Web Server on Windows 95 or Peer Web Services on Windows NT 4.0 Workstation have already been successfully installed.

If Visual InterDev is still unable to connect to the Web server after following the steps outlined in Workaround 3 above, check the following configuration settings for Windows 95 and change them as necessary. (For Windows NT Workstation, see the Windows NT Workstation documentation on how to configure these settings):


 * 1) Go into the Control Panel and double-click Networks.
 * 2) Click the Identification tab, and ensure that Computer Name is the same as the local machine name used in the HOSTS file.
 * 3) Click the Access tab, and ensure that "share-level access control" is selected.
 * 4) Click the Configuration tab, select TCP/IP, and then click Properties.
 * 5) Select "Bindings," and ensure that Personal Web Server is bound to TCP/IP.
 * 6) Select "DNS Configuration," and ensure that "Disable DNS" is selected.
 * 7) Select "WINS Configuration" and change the default setting from "Use DHCP for WINS Resolution" to "Disable WINS Resolution."
 * 8) Reboot, and then try to connect Visual InterDev to Personal Web Server.

