You can make an MDriven model open on its model surface in Visual Studio when a .ecomdl file opens as XML instead.
Symptoms
An MDriven model stored as an .ecomdl file should open in the MDriven model designer in Visual Studio. If Visual Studio displays the file in its XML designer, the file has been associated with the wrong editor or the MDriven Framework is not installed for the Visual Studio version you use.
For example, if MyModel.ecomdl opens as XML markup rather than showing classes, associations, views, and actions on the model surface, follow the steps below.
Select the MDriven editor
- In Solution Explorer, right-click the
.ecomdlmodel file. - Select Open With....
- In the dialog box, select Modlr files (Default).
- Click OK.
- Open the model file again and confirm that it opens on the model surface.
If the model still opens as XML
Check the project-file entry for the model. Visual Studio can tag an .ecomdl file as a designer subtype, which causes it to use the XML designer.
- Load the project file for manual editing.
- Find the entry for the affected
.ecomdlfile. - Remove the
<SubType>Designer</SubType>element. - Save the project file and reopen the solution.
The incorrect entry looks like this:
<None Include="yourmodel.ecomdl">
<SubType>Designer</SubType>
</None>
It should instead be:
<None Include="yourmodel.ecomdl" />
Verify the Visual Studio installation
If Modlr files (Default) is not available, or the model still does not open on the model surface after correcting the project entry, install the MDriven Framework for the Visual Studio version you are running. The MDriven Framework installation supplies the Visual Studio support used to view and work with the model.
When you use a .NET project, the MDriven Framework extension is required to view the model inside Visual Studio. For the complete setup and model code-generation workflow, see HowTos:How To Create a .NET Core MDriven Project.
What this fix does not address
This procedure fixes the editor association for the model file. It does not fix generated-code structure or build problems. If code generation produces incorrect file dependencies, follow HowTos:Fix Code Generation Issues.
