🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Visual Studio 2022
This page was created by Hans.karlsen on 2021-11-17. Last edited by Wikiadmin on 2026-07-29.

You can install the MDriven Framework integration in Visual Studio 2022 as a VSIX extension, use NuGet packages for your application runtime references, and resolve common model-editor and code-generation issues.

Install the MDriven VS2022 extension

MDriven uses a separate Visual Studio 2022 build because Visual Studio extensions for VS2022 are not backward compatible with extensions for earlier Visual Studio versions. The VS2022 integration is distributed as a VSIX (Visual Studio Extension) installer rather than the historical executable installer.

  1. Download the MDriven Framework VSIX installer from the downloads area on MDriven.net.
  2. Close Visual Studio 2022.
  3. Run the downloaded .vsix file on the computer where you use Visual Studio.
  4. Follow the VSIX installer prompts to install or update the extension.
  5. Start Visual Studio 2022.

After installation, MDriven appears in Visual Studio's installed extensions and provides an MDriven entry under the Tools menu. Open Tools → MDriven → About to confirm that the extension is loaded and to see its installation path.

The VSIX contains the design-time integration: the Model editor (Modlr), code generation integration, and Visual Studio templates. Your application should obtain its runtime assemblies through NuGet; do not depend on locating runtime assemblies in the VSIX installation folder.

For the current installation details and compatibility information, see Documentation:MDriven Framework Visual Studio installation. Builds from 2026 onward also support running the Visual Studio integration side by side with VS2022 and VS2026; see Documentation:VS2026 is now supported - what we changed and what we learned.

Create projects and templates

After the extension is installed, MDriven project templates should be available when you create a new project in Visual Studio 2022. Templates create the starting project structure for an application that uses the MDriven Framework.

If MDriven templates are missing:

  1. Verify that the VSIX extension is installed.
  2. Restart Visual Studio 2022.
  3. Check the template locations and reset guidance in Documentation:Visual Studio Templates.
  4. If the templates still do not appear, verify which user profile and Documents location was used during installation. A redirected Documents folder, including one redirected to OneDrive, can cause templates to be installed for a different user location.

For a .NET project workflow, follow HowTos:How To Create a .NET Core MDriven Project.

Reference MDriven packages in your project

Use MDriven NuGet packages when your code references MDriven runtime assemblies. This keeps the application runtime separate from the Visual Studio design-time extension and lets your project select and update its package versions through NuGet.

For example, when a project created from a template has older package versions, use Visual Studio's NuGet package management to review available MDriven package updates and update when you need a newer build or a required fix. You do not need to update packages for every nightly build.

Some MDriven packages reference SQL Server Compact Edition. If package restore or compilation reports that the SQL Server Compact reference is unresolved, add this NuGet package to the project:

System.Data.SqlServerCe_unofficial

The VSIX and NuGet packages have distinct roles:

Component Purpose How you obtain it
MDriven VSIX Visual Studio design-time integration, including Model editor and code-generation integration Install the VS2022 .vsix file
MDriven NuGet packages Runtime assemblies referenced by your application Add and update them in the project through NuGet
System.Data.SqlServerCe_unofficial Resolves SQL Server Compact Edition references used by some MDriven packages Add it through NuGet when the reference is unresolved

Fix “Misc Files” model errors and changes that do not save

When Visual Studio treats an .ecomdl model file as a miscellaneous file rather than a file belonging to your project, the MDriven editor cannot reliably save changes or generate code. You may see an error similar to:

Model file "C:\_path_to_your_project\YourProject.ecomdl" belongs to the "Misc Files" project.
Please add it to a real project, then close and reopen the editor tab.

First, make sure that the .ecomdl file is included in the intended Visual Studio project. Then close its editor tab and reopen it. If the issue began after upgrading to Visual Studio 2022, remove the local Visual Studio workspace cache:

  1. Commit or otherwise back up all pending changes. In particular, ensure that pending Git changes are checked in before removing local workspace data.
  2. Close Visual Studio.
  3. In the root folder of the solution or project, enable viewing of hidden items in File Explorer.
  4. Delete the hidden .vs folder.
  5. Reopen the solution in Visual Studio 2022.
  6. Verify that the .ecomdl file appears under a real project in Solution Explorer, not under Misc Files.
  7. Open the model again and retry saving or generating code.

The .vs folder can retain workspace information from an earlier Visual Studio version. Removing it resets that local cache; it does not replace the need to keep the model file in the project.

Build the VS2022 VSIX (MDriven maintainers)

This section is for administrators and developers building the MDriven Visual Studio extension, not for users installing the published VSIX.

The build script 2022BUILDMDrivenVSIX.cmd uses an environment variable named RevNumber to stamp the extension revision into the VSIX manifest.

  1. Create an environment variable named RevNumber.
  2. Set its value to a numeric revision, for example 123.
  3. Run 2022BUILDMDrivenVSIX.cmd.

The script injects RevNumber into source.extension.vsixmanifest using source.extension.vsixmanifest.template. The build engine later updates RevNumber from the SVN version identifier.

See also