This documentation is archived and is not being maintained.

How to: Add the CrmDiscoveryService Web Reference: CRM Online

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

The typical procedure to add a Web Reference to a Visual Studio project is shown in the following procedure. Due to an issue with accessing the Web service directly, you can use the Discovery Service WSDL located in the download package for the SDK. The CrmDiscoveryService.wsdl file is located in the folder SDK\WSDL. For more information about the SDK download, see Sample Code.

Alternatively, you can save the WSDL from Microsoft Dynamics CRM Online to your computer with the following steps:

  1. Open Internet Explorer and enter the following URL:
  2. In the File menu, click Save As.
  3. Name the file CrmDiscoveryService.wsdl and save it to an appropriate location on your computer.

To Add the Web Reference to your Visual Studio Project

  1. Create a C# or Visual Basic .NET project in Microsoft Visual Studio.
  2. In Solution Explorer, right-click References.
  3. Select Add Web Reference if you are using Visual Studio 2005. For Visual Studio 2008, select Add Service Reference, click Advanced, and then click Add Web Reference.
  4. In the URL field, enter the path to the CrmDiscoveryService.wsdl file:
  5. Click Go.
  6. Edit the Web reference name. This is the name that you will put in the Using statement in the source code. For this example, type CrmSdk.Discovery.
  7. Click Add Reference.

The Microsoft Dynamics CRM CrmDiscoveryService Web service namespace is now available to your project. In the project source code, add one of the following statements:


using CrmSdk.Discovery

[Visual Basic .NET]

Imports CrmSdk.Discovery

You can now refer to the classes and methods that are in this SDK.

See Also


© 2010 Microsoft Corporation. All rights reserved.