Multiple DSLs in One Solution

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can package several DSLs as part of a single solution so that they are installed together.

You can use several techniques to integrate multiple DSLs. For more information, see Integrating Models by using Visual Studio Modelbus and How to: Add a Drag-and-Drop Handler and Customizing Copy Behavior.

Build more than one DSL in the same solution

  1. Create a new VSIX Project project.

  2. Create two or more DSL projects in the VSIX solution directory.

    • For each DSL, open a new instance of Visual Studio. Create the new DSL, and specify the same solution folder as the VSIX solution.

    • Make sure that you create each DSL with a different filename extension.

    • Change the names of the Dsl and DslPackage projects so that they are all different. For example: Dsl1, DslPackage1, Dsl2, DslPackage2.

    • In each DslPackage*\source.extension.tt, update this line to the correct Dsl project name:

      string dslProjectName = "Dsl2";

    • In the VSIX solution, add the Dsl* and DslPackage* projects. You might want to place each pair in its own solution folder.

  3. Combine the VSIX manifests of the DSLs:

    1. Open YourVsixProject\source.extension.manifest.

    2. For each DSL, choose Add Content and add:

      • Dsl* project as a MEF Component

      • DslPackage* project as a MEF Component

      • DslPackage* project as a VS Package

  4. Build the solution.

    The resulting VSIX will install both DSLs. You can test them by using F5, or deploy YourVsixProject\bin\Debug\*.vsix.

See also