Sdílet prostřednictvím


Creating the project for the document type

To build a .NET assembly for your document type, use Visual Studio to create a library project. To create the project, complete the following procedure:

  1. Create a Visual Studio class library project.

    Open Visual Studio.

    Warning: You must be using Visual Studio 2010 or later, and your project must target the .NET Framework 4.

    In the File menu, point to New, and then click Project. In the New Project window, select Visual C# in the Project types list. In Templates, select Class Library from the list of Visual Studio installed templates.

    Enter a name for your project. A typical project name includes the company name, the product name, and the document type. For example, the Leads service uses the following project name:

    Microsoft.Dynamics.GP.Samples.Leads
    
The name you specify will be the namespace for all the classes in your document type.

Review the Location and Solution Name, and then click OK.
  1. Delete the Class1.cs file from the project.

    By default, Visual Studio creates a file named Class1.cs. The Class1.cs file is not needed. To delete the file, open the View menu, and choose Solution Explorer. Use Solution Explorer to find Class1.cs, and delete it from the project.

    If a dialog window opens asking whether to delete the file, click OK.

  2. Add references.

    In the Project menu, choose Add References. The Add References window opens. Click the Browse tab and navigate to the Dynamics GP "GPWebServices" folder, typically found in the following location:

    C:\Program Files\Microsoft Dynamics\GPWebServices

    Select the following assemblies, and then click OK:

    • Microsoft.Dynamics.Common.dll

    • Microsoft.Dynamics.Common.Types.dll

    • Microsoft.Dynamics.GP.BusinessLogic.dll

  3. Save the project.

    In the File menu, choose Save.