How to: Add the CrmDiscoveryService Web Reference

How to: Add the CrmDiscoveryService Web Reference

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. Note there are two URLs shown for the CrmDiscoveryService Web service. The one that you use depends on the method of authentication required by the Microsoft Dynamics CRM installation. For Microsoft Dynamics CRM Online, see How to Add the CrmDiscoveryService Web Reference: CRM Online.

  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, paste the following string, replacing <server name> with the name of a Microsoft Dynamics CRM Server. The TCP port number in the Web service URL is optional and only required if Microsoft Dynamics CRM is installed to a nondefault Web site on the server.

    For Active Directory Authentication (on-premise):


    For Active Directory Authentication (IFD):

  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.

© 2015 Microsoft