You can use MDriven in Visual Studio to open an .ecomdl model in the model editor and use MDriven code generation; this page is for developers who need the Visual Studio integration to recognize and open a model correctly.
What the Visual Studio integration provides
When the MDriven Framework integration is installed for the Visual Studio version you use, Visual Studio can invoke the MDriven model editor and code-generation features for an .ecomdl model file.
For example, when your solution contains MyApplication.ecomdl, opening that file should display the model surface rather than an XML editor.
This integration is separate from local MDriven Turnkey development in Visual Studio. Local Turnkey development is for running and debugging a Turnkey application locally, including adding code or overriding pages. If your task is to create a project from an MDriven template, use Visual Studio Templates.
Open a model file in Visual Studio
- Confirm that the MDriven Framework integration is installed for the Visual Studio version that opens the solution. Follow MDriven Framework Visual Studio installation.
- Open the solution in Visual Studio.
- In Solution Explorer, locate the
.ecomdlfile. - Right-click the model file and select Open With....
- Select Modlr files (Default), then select OK.
For the focused recovery procedure, see Fix Visual Studio Not Opening Model File.
If the model opens as XML
If the file opens in an XML editor instead of the model surface, work through the following checks in order.
Check the installed Visual Studio integration
The most common cause is that MDriven Framework support is not installed for the version of Visual Studio currently in use. Install or verify the correct integration by following the installation instructions, then restart Visual Studio and open the model again.
For version-specific background on the older Visual Studio 2019 integration, see Visual Studio 2019. For current information about Visual Studio 2022 and Visual Studio 2026 compatibility and the design-time/runtime assembly separation, see VS2026 is now supported - what we changed and what we learned.
Remove the XML Designer subtype from the project file
Visual Studio can persist a file association in the project file that makes an .ecomdl file open as XML. Look for the model-file entry in the project file.
An entry that forces the Designer subtype can look like this:
<None Include="yourmodel.ecomdl">
<SubType>Designer</SubType>
</None>
Change it to an entry without <SubType>Designer</SubType>:
<None Include="yourmodel.ecomdl" />
For example, if the model is named Sales.ecomdl, remove the SubType element from its None Include="Sales.ecomdl" entry.
- Close the solution, or unload the project, before editing the project file so Visual Studio does not overwrite the change.
- Open the project file in a text editor.
- Find the
None Includeentry for the affected.ecomdlfile. - Remove the
SubTypeelement. - Save the project file.
- Reload the project or reopen the solution.
- Right-click the model file, choose Open With..., and select Modlr files (Default).
Choose the right development path
| Your goal | Start here |
|---|---|
Open and work with an .ecomdl model in Visual Studio
|
Install the integration and use the model-opening steps on this page. |
| Create an MDriven project from Visual Studio templates | Visual Studio Templates |
| Run and debug a Turnkey application locally, add C# code, or override a page | Development in Visual Studio |
| Work on HTML, JavaScript, or CSS against a local prototype | Visual Studio Code |
| Automate builds | Continuous Integration |
