🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
NugetProject
This page was created by Hans.karlsen on 2018-10-07. Last edited by Wikiadmin on 2026-07-29.

You use MDriven NuGet packages to add the MDriven runtime assemblies to your application; this page is for developers building MDriven applications in Visual Studio.

Use NuGet packages for runtime

Install MDriven runtime dependencies from the MDriven NuGet profile. Do not copy runtime assemblies from the locally installed MDriven Visual Studio extension into your application.

The MDriven Visual Studio extension provides design-time support, including working with a model in MDriven Designer. The extension is installed locally in Visual Studio, and its assemblies are intended for that design-time environment. Your application must instead restore the MDriven assemblies it needs through NuGet.

For example, a project created from the MDriven solution template restores its runtime dependencies from NuGet. When you update those package references and rebuild, the application uses the runtime assemblies supplied by the restored packages rather than assemblies found in the Visual Studio extension folder.

Install and update packages

  1. Open your application solution in Visual Studio.
  2. Add or update the MDriven package references required by the project from the MDriven NuGet profile.
  3. Restore packages and build the solution.
  4. Keep the package versions used by the application under source control so that every developer and build environment restores the same runtime version.

Use the packages appropriate for your target framework. MDriven publishes packages for current .NET and legacy .NET Framework scenarios. For guidance on creating a project and refreshing the packages supplied by the solution template, see Documentation:MDrivenFramework.

Choose the target framework package

MDriven recommends moving applications to .NET 8 and using the corresponding MDriven NuGet packages rather than using .NET Framework packages or assemblies from an installation directory.

Application target What to do Example
.NET 8 Use the MDriven NuGet packages for .NET 8. A new application targets .NET 8, restores its MDriven dependencies from NuGet, and deploys the restored application output.
.NET Framework 4.8 Use the MDriven NuGet packages that support .NET Framework 4.8 while you maintain the application. An existing desktop application remains on .NET Framework 4.8 and references its runtime through NuGet rather than through files from the extension installation.

.NET 8 removes the dependency on the Global Assembly Cache (GAC). The GAC can take precedence over assemblies on disk and can make assembly-loading issues difficult to diagnose. Nothing from .NET 8 is installed in the GAC.

For target-framework strategy, migration context, and the current limitations noted for WCF, see Documentation:Dotnet core. For a step-by-step .NET project setup, including saving a model as .ecomdl and generating C# code, see HowTos:How To Create a .NET Core MDriven Project.

Understand package and assembly versions

The NuGet package version is the exact identity of the MDriven runtime build you use. Use that version when you need to identify, compare, update, or report the runtime build in an application.

Assembly version numbers are not the exact build identity. MDriven assemblies use a shared product version so that Visual Studio can recognize an assembly loaded by the MDriven design-time tools as equivalent to the corresponding assembly used by an application. This avoids conflicts between the Visual Studio extension and the NuGet-based runtime.

Item Use it for Do not use it for
NuGet package version Identifying the exact runtime build restored by your application. Assuming that a locally installed extension folder supplies the same runtime files.
Assembly product version Identifying the shared product-version line of an assembly. Determining the exact NuGet build installed in the application.

For example, if two restored packages have different NuGet versions but their contained assemblies show the same product version, treat the package versions as the authoritative distinction between the builds.

Find locally installed design-time assemblies

You can inspect the MDriven Visual Studio extension location from Visual Studio's About dialog. This can help you diagnose what the extension has loaded. It does not change the runtime deployment rule: reference runtime assemblies through NuGet.

If an application has references that point into a Visual Studio extension directory, replace those references with the applicable NuGet package references, restore packages, and rebuild. This keeps the application independent of an individual developer's Visual Studio installation.

Licensing

All MDriven and CapableObjects assemblies are subject to the same license. You need a valid, up-to-date license during both development and production.

See also