How to: Test Domain-Specific Language Solutions
You create a domain-specific language solution using the Domain-Specific Language Designer Wizard. Before you begin to modify your solution, you should test it. The procedure that you use to test the initial solution is the same procedure that you use to test your solution after you modify it.
Your domain-specific language solution has two projects. One is named Dsl, and the other is named DslPackage. These two projects appear in Solution Explorer. If you look at your solution in Windows Explorer, you see a third folder called Debugging. The Debugging folder contains a separate debugging solution that you use to test your domain-specific language.
Note
You do not open the debugging solution alone. You launch it from your domain-specific language solution.
To test a domain-specific language solution
On the Build menu, click Build Solution.
On the Debug menu, click Start Debugging.
A new instance of the Visual Studio experimental build launches and opens the debugging solution. For more information about the experimental build, see Experimental Build.
(Optional) In Solution Explorer, open the file named Sample. This file contains a sample model that is based on the same solution template on which your solution is based.
Note
The Sample file has the extension that you entered in the wizard when you created your solution.
Important Note: After you modify your underlying solution, the Sample file might not be valid.
(Optional) In Solution Explorer, there are two sample text templates (with a .tt extension) that are based on the same solution template as your solution. Click one of the files, and expand its node. The file under it is the generated text output from the text template. Right-click the generated text file, and then click View in Browser. An HTML report appears and lists the objects in the Sample file.
When you finish testing, close the experimental build to return to your underlying solution.
You can now modify your solution to change the language. To test your changes, repeat this procedure.
Adding Models to Your Debugging Project
Whether you have just created a solution or you have already started to modify one, you can test how the domain-specific language behaves from your language user's point of view. You can use the debugging solution to add a model and exercise the language to verify that it works correctly.
To add a model to your project and exercise the language
On the Build menu, click Build Solution.
On the Debug menu, click Start Debugging.
A new instance of the Visual Studio experimental build launches and opens the debugging solution. For more information about the experimental build, see Experimental Build.
In Solution Explorer, right-click the project node, point to Add, and then click New Item.
The Add New Item dialog box appears.
Under Templates, scroll down to the My Templates section, and click the template that has the same name as your domain-specific language.
Click Add.
A model file is added to the project.
On the View menu, click Toolbox.
The Toolbox opens and displays tools that are appropriate for the solution template on which your solution is based. You can modify your language to add tools to the Toolbox.
Drag items from the Toolbox to your new model, and test whether your domain-specific language is working correctly. You are now testing your language from the point of view of your language user.
When you finish testing, close the experimental build to return to your underlying solution.
You can now modify your solution to change the language. To test your changes, repeat this procedure.
Security
For more information, see Security of Text Templates.
See Also
Concepts
Domain-Specific Language Tools Overview
Choosing a Domain-Specific Language Solution Template