5 out of 5 rated this helpful - Rate this topic

Troubleshooting the Getting Started Tutorial

This topic lists the most common problems encountered when working through the Getting Started Tutorial and how to resolve them.

  1. I am unable to find the project files on my hard drive.

  2. Attempting to run the service application: HTTP could not register URL http://+:8000/ServiceModelSamples/Service/. Your process does not have access rights to this namespace.

  3. Attempting to use the Svcutil.exe tool: 'svcutil' is not recognized as an internal or external command, operable program or batch file.

  4. Unable to find the App.config file generated by Svcutil.exe.

  5. Compiling the client application: 'CalculatorClient' does not contain a definition for '<method name>' and no extension method '<method name>' accepting a first argument of type 'CalculatorClient' could be found (are you missing a using directive or an assembly reference?)

  6. Compiling the client application: The type or namespace name 'CalculatorClient' could not be found (are you missing a using directive or an assembly reference?)

  7. Unhandled Exception: System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost:8000/ServiceModelSamples/Service/CalculatorService. TCP error code 10061: No connection could be made because the target machine actively refused it.

Visual Studio saves project files in c:\users\<user name\Documents\Visual Studio 2010\Projects in Windows Vista and Windows°7, and c:\Documents and Settings\<user name>\My Documents\Visual Studio 2010\Projects in earlier versions of Windows.

The process that hosts a WCF service must be run with Administrative privileges. If you are running the service from inside Visual Studio 2010 you must run Visual Studio 2010 as an Administrator. To do so click Start, right-click Visual Studio 2010 and select Run As Administrator. If you are running the service from a command-line prompt you must start the command line prompt as an Administrator in a similar way. Click Start, right-click Command Prompt and select Run As Administrator.

Svcutil.exe must be in the system path. The easiest solution is to use the Command Prompt. Click Start, select All Programs, Visual Studio 2010, Visual Studio Tools, and Visual Studio 2010 Command Prompt. This command prompt sets the system path to the correct locations for all tools shipped as part of Visual Studio 2010.

The Add Existing Item dialog only displays files with the following extensions by default: .cs, .resx, .settings, .xsd, .wsdl. You can specify that you want to see all file types by selecting All Files (*.*) in the drop down list box in the lower right corner of the Add Existing Item dialog box.

Only those methods that are marked with the ServiceOperationAttribute are exposed to the outside world. If you omitted the ServiceOperationAttribute attribute from one of the methods in the ICalculator interface you get this error message when compiling a client application that makes a call to the operation missing the attribute.

This error occurs on a domain-joined computer that does not have network connectivity. Either connect your computer to the network or turn off security for both the client and the service. For the service, modify the code that creates the WSHttpBinding to the following.

// Step 3 of the hosting procedure: Add a service endpoint
selfHost.AddServiceEndpoint(typeof(ICalculator), new WSHttpBinding(SecurityMode.None), "CalculatorService");

For the client, change the <security> element under the <binding> element to be the following:

<security mode="None" />
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.