Troubleshooting the Getting Started Tutorial

Visual Studio saves project files in c:\users\<user name\Documents\<Visual Studio version>\Projects in Windows Vista and Windows°7, and c:\Documents and Settings\<user name>\My Documents\<Visual Studio version>\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 2012 you must run Visual Studio 2012 as an Administrator. To do so click Start, right-click Visual Studio 2012 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 2012, Visual Studio Tools, and Visual Studio 2012 Command Prompt. This command prompt sets the system path to the correct locations for all tools shipped as part of Visual Studio 2012.

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="Node" />
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft