You can use MDriven Visual Studio templates to create starter projects, and use this page to locate or restore those templates when they do not appear in New Project.
What Visual Studio templates do
Visual Studio templates are project and item definitions that provide a starting point for applications that run the MDriven Framework. For example, a solution template can create the initial solution structure rather than requiring you to create each project manually.
Templates are distinct from the MDriven Visual Studio integration. The integration provides features such as opening an .ecomdl model as a model surface and generating code. See Documentation:Visual Studio and Documentation:MDriven Framework Visual Studio installation for installation and integration troubleshooting.
How legacy templates are installed
For the Visual Studio template system used by earlier MDriven installations, MDriven writes template manifest files to your Visual Studio Documents template location. A manifest identifies the ZIP file that contains the actual template.
For example, a manifest can contain:
<RelativePathOnDisk>CSharp\MDriven7.0\Eco7.0Solution_cs.zip</RelativePathOnDisk>
The referenced template archive is stored under the corresponding templates folder, for example:
<Templates>\MDriven7.0\Eco7.0Solution_cs.zip
MDriven manifest files include:
MDrivenSolution.vstmanMDrivenEcoSpaceAndModel.vstman
The generic Visual Studio template location is typically under the installing user's Documents folder:
C:\Users\<User>\Documents\Visual Studio 201X\Templates
The exact folder depends on the Visual Studio version and on the actual location of that user's Documents folder.
Restore missing templates
If MDriven templates are missing from New Project, first confirm which Windows account installed MDriven. Visual Studio templates may have been installed under that account's Documents folder, while you are running Visual Studio under a different account.
- Close Visual Studio.
- Determine the real location of your Documents folder. Do not assume that it is
C:\Users\<User>\Documents; Windows may redirect Documents to OneDrive or another location. - Under the Documents folder of the user who installed MDriven, find the MDriven template folders. The relevant paths are:
Documents\Visual Studio 201X\Templates\ItemTemplates\MDriven
Documents\Visual Studio 201X\Templates\ProjectTemplates\MDriven
- Copy the
MDrivenfolders to the same relative locations under the Documents folder for the user who will run Visual Studio. - Start Visual Studio and check New Project again.
For example, if MDriven was installed by a local administrator but you use a separate development account, copy the administrator's ProjectTemplates\MDriven folder to your own Documents\Visual Studio 201X\Templates\ProjectTemplates\MDriven folder. Copy the item-template folder in the same way.
Refresh the Visual Studio template configuration
If the files are present but the templates still do not appear, refresh Visual Studio's configuration.
For Visual Studio 2017:
- Close Visual Studio.
- Open the Developer Command Prompt for VS 2017.
- Run:
devenv /updateconfiguration
- Start Visual Studio and check the available templates.
Earlier Visual Studio versions used devenv /setup. This page does not establish whether that command has the same effect in Visual Studio 2017 or later; use devenv /updateconfiguration for the Visual Studio 2017 case described above.
Choose the current starting approach
Template availability and template content vary by Visual Studio and MDriven version. For current Visual Studio setup, install the MDriven extension by following Documentation:MDriven Framework Visual Studio installation.
If you are creating a .NET project, follow HowTos:How To Create a .NET Core MDriven Project instead of relying on a legacy template. That procedure creates a .NET console application, adds the MDriven.MVC.Core NuGet package, adds the expanded .ecomdl model, and uses Visual Studio code generation.
For local MDriven Turnkey development and debugging, use HowTos:Development in Visual Studio. That workflow is for running a Turnkey server locally; it is not a template-recovery procedure.
Troubleshooting checklist
| Symptom | Check | Action |
|---|---|---|
| MDriven templates are absent from New Project | The Documents folder may be redirected, or templates may belong to a different Windows user. | Locate the installing user's ItemTemplates\MDriven and ProjectTemplates\MDriven folders and copy them to the active user's matching template folders.
|
| Template files exist but Visual Studio does not list them | Visual Studio may not have refreshed its configuration. | In the Developer Command Prompt for VS 2017, run devenv /updateconfiguration, then restart Visual Studio.
|
An .ecomdl file opens as XML
|
This is an integration or project-file issue, not a missing-template issue. | Follow Documentation:Visual Studio to verify the extension and the model file's project entry. |
| You need to create a modern .NET-based project | A legacy template may not be the appropriate starting point. | Follow HowTos:How To Create a .NET Core MDriven Project and review Documentation:Dotnet core. |
