Compartir a través de


How to: Create Domain-Specific Language Solutions

When you create a domain-specific language solution, you use the Domain-Specific Language Designer Wizard. In the wizard, you specify one of several solution templates. After you complete the wizard, a solution is created based on the solution template that you selected. To minimize the modifications that you must make to the starting solution, you should specify the solution template that matches most closely the language that you want to create. For more information, see Choosing a Domain-Specific Language Solution Template.

To create a domain-specific language solution

  1. On the File menu, point to New, and then click Project.

    The New Project dialog box appears.

  2. Under Project types, expand the Other Project Types node, and click Extensibility.

  3. Under Templates, click Domain-Specific Language Designer.

  4. In Name, type an appropriate name for the solution, and click OK.

    The Domain-Specific Language Designer Wizard appears.

  5. On the Select Domain-Specific Language Options page, click a solution template.

    A description of the solution template that you clicked appears next to the list of solution templates. For more information, see Choosing a Domain-Specific Language Solution Template.

    Nota

    You can switch between large and small icons in the list of solution templates by clicking the Large icons and Small icons buttons. These buttons appear next to the list of solution templates.

  6. In What do you want to name your domain-specific language, type an appropriate name.

    The name that you specified for the solution appears by default.

    Nota

    The name that you type must be a valid Visual C# identifier because it will be used to generate code.

  7. If you are satisfied with your template and name selections, click Next.

  8. On the Define New Model File Type page, either use the default file name extension provided, or type an appropriate and unique file name extension to be associated with your domain-specific language.

  9. (Optional) Select the Unregister domain-specific language tools that currently handle this extension check box if you want to disassociate a file name extension from a previous domain-specific language and register the file name extension with the new domain-specific language.

  10. In What icon should model files use, click an icon in the list, or specify the path of an icon. You can specify the path either by typing it or by clicking the browse button (…).

    Advertencia

    Icons must be 16 pixels high by 16 pixels wide to appear in the Toolbox.

    You can modify the icon that is associated with your domain-specific language in the solution (after you finish using the wizard) if you need to.

  11. If you are satisfied with your file name extension and icon selections, click Next.

  12. On the Specify Product Details page, in the What is the name of the product that the new domain-specific language belongs to? box, type an appropriate name for the product.

    The solution name appears by default.

  13. In the What is the name of the company that the product belongs to? box, type the name of the company that is associated with the product.

  14. In the What is the root namespace for the projects in the solution? box, type an appropriate namespace.

    The default namespace is a combination of the entries that you provided for the product name and the company name.

    Advertencia

    Consider the namespace carefully because changing it after running the Domain-Specific Language Designer Wizard is difficult. For more information, see How to: Change the Namespace for a Designer.

  15. Click Next.

  16. On the Select Strong Name Signing Method page, specify a strong name with which the package assemblies will be signed. For more information, see How to: Sign an Assembly with a Strong Name. You can click either of two options:

    • If you click Create a strong name key file, a strong name key file, named key.snk, is added to the solution, and assemblies are signed using this file.

    • If you click Use existing strong name key file, click the Browse button, and browse to an existing key file, assemblies are signed or delay-signed using the file that you specified.

      Nota

      If you specify a file that contains only the public key portion, assemblies will be delay-signed only, which might prevent the solution from running correctly.

  17. Click Next.

  18. On the Review Details of the Domain-Specific Language Solution page, review the settings that you have specified. If changes are necessary, click Previous to make corrections. When you are satisfied with the settings, click Finish.

    A solution is created that is based on the solution name and the solution template that you specified. The solution has two projects, which are named Dsl and Dsl Package.

    Nota

    Some files in domain-specific language solutions are generated by using the text template transformation process. When you create a domain-specific language solution, the generated files are processed.

See Also

Concepts

Overview of Domain-Specific Language Tools

Choosing a Domain-Specific Language Solution Template

How to: Test Domain-Specific Language Solutions

Walkthrough: Creating a Domain-Specific Language Solution

Domain-Specific Language Designer Terminology Overview

Domain-Specific Language Tools Glossary