VOOZH about

URL: https://www.nuget.org/packages/Microsoft.Dism/

⇱ NuGet Gallery | Microsoft.Dism 6.0.0




Microsoft.Dism 6.0.0

dotnet add package Microsoft.Dism --version 6.0.0
 
 
NuGet\Install-Package Microsoft.Dism -Version 6.0.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Dism" Version="6.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Dism" Version="6.0.0" />
 
Directory.Packages.props
<PackageReference Include="Microsoft.Dism" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Dism --version 6.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Dism, 6.0.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Dism@6.0.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Dism&version=6.0.0
 
Install as a Cake Addin
#tool nuget:?package=Microsoft.Dism&version=6.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Managed DismApi Wrapper

👁 Build Status
👁 Microsoft.Dism
👁 NuGet

This is a managed wrapper for the native .

This assembly allows .NET developers to call directly into the DismApi without having to shell out to Dism.exe. This allows for better integration and richer errors.

Runtime Requirements

The DISM API files are available in all Windows® 8 operating systems. You can also run DISM API applications on any Windows operating system that is supported by the Windows ADK. You must install the Windows ADK in order to run DISM API applications on these operating systems. For more information about supported operating systems, see the Windows® Assessment and Deployment Kit (Windows ADK) Technical Reference.

Getting Started

Install the NuGet package:

<ItemGroup>
 <PackageReference Include="Microsoft.Dism" Version="<version>" />
</ItemGroup>

The wrapper is as close to the native DismApi as possible. Most methods in the DismApi class should mirror the functions in the DismApi. Managed classes are used in place of the native structs and I tried to keep the property names the same. I also included XML doc comments on every class, method, and property which should help with development.

Initializing DISMAPI

You'll need to initialize the DismApi first (don't forget to call Shutdown() at the end of your program)

DismApi.Initialize(DismLogLevel.LogErrors);

DismApi.Shutdown();

List Images

An example on how to list the images contained in a WIM file:

// Path to the WIM file
string imagePath = @"C:\image.wim";

// Initialize the DismApi
DismApi.Initialize(DismLogLevel.LogErrors);

try
{
	// Get the images in the WIM
	DismImageInfoCollection imageInfos = DismApi.GetImageInfo(imagePath);

	// Print the image path and image count
	Console.WriteLine("Image {0} contains {1} image(s)", imagePath, imageInfos.Count);

	// Loop through each image
	foreach(DismImageInfo imageInfo in imageInfos)
	{
		// Print the image index and name
		Console.WriteLine("Image Index: {0}", imageInfo.ImageIndex);
		Console.WriteLine("Image Name: {0}", imageInfo.ImageName);
		Console.WriteLine("------------------------");
	}
}
finally
{
	// Shut down the DismApi
	DismApi.Shutdown();
}

Mounting Images

An example on how to mount an image, list the features, and unmount it:

string imagePath = @"C:\image.wim";
string mountPath = @"C:\temp\mount";
int imageIndex = 1;

// Initialize the DismApi
DismApi.Initialize(DismLogLevel.LogErrors);

try
{
	// Create the mount dir if it doesn't exit
	if(Directory.Exists(mountPath) == false)
	{
		Directory.Create(mountPath);
	}

	// Mount the image
	DismApi.MountImage(imagePath, mountPath, imageIndex);

	// Open a session to the mounted image
	using(DismSession session = DismApi.OpenOfflineSession(mountPath))
	{
		// Get the features of the image
		DismFeatureCollection features = DismApi.GetFeatures(session);

		// Loop through the features
		foreach(DismFeature feature in features)
		{
			// Print the feature name
			Console.WriteLine("Feature: {0}", feature.FeatureName);
		}
	}

	// Unmount the image and discard changes
	DismApi.UnmountImage(mountPath, false);
}
finally
{
	// Shut down the DismApi
	DismApi.Shutdown();
}

Using DismProgressCallback

DismProgressCallback is a delegate that receives progress updates during certain operations.

static void Main(string[] args)
{
 DismApi.Initialize(DismLogLevel.LogErrors);
 try
 {
 using (DismSession session = DismApi.OpenOnlineSession())
 {
 List<string> sourcePaths = new List<string>();

 DismApi.AddCapability(
 session,
 capabilityName: "Capability",
 limitAccess: false,
 sourcePaths: new List<string>(),
 progressCallback: HandleProgress,
 userData: null);
 }
 }
 finally
 {
 DismApi.Shutdown();
 }
 
}

private static void HandleProgress(DismProgress progress)
{
 // Print the current progress
 //
 Console.WriteLine("Current: {0}", progress.Current);
 Console.WriteLine("Total: {0}", progress.Total);

 if (progress.Current == 50)
 {
 // Cancel the operation at 50%
 //
 progress.Cancel = true;
 }
}

Contributing

Please read the for information on building the code and contributing to the project.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Microsoft.Dism:

Package Downloads
Redpoint.KubernetesManager

Implements a Kubernetes manager, which can provision and set up Kubernetes on Windows, macOS and Linux machines.

TXQ.Utils

Package Description

GitHub repositories (9)

Showing the top 9 popular GitHub repositories that depend on Microsoft.Dism:

Repository Stars
lostindark/DriverStoreExplorer
Driver Store Explorer
redcode-labs/easyWSL
Create WSL distros based on Docker Images.
Fs00/Win10BloatRemover
Configurable CLI tool to easily and aggressively debloat and tweak Windows 10 by removing preinstalled UWP apps, services and more. Originally based on the W10 de-botnet guide made by @adolfintel.
CodingWonders/MicroWin
The future home of MicroWin.
container-desktop/container-desktop
Provides an alternative for Docker for Desktop on Windows using WSL2.
t-richards/chemo
Remove pre-installed junk from Windows 10.
RedpointGames/uet
UET (Unreal Engine Tool) makes building and testing Unreal Engine projects and plugins easy. It can distribute builds with BuildGraph, remotely execute automation tests on device and across multiple machines, handles fault tolerance and automatic retries and generally makes the whole experience of automating Unreal Engine a lot more pleasant.
ProjectCeleste/Celeste.Launcher
FuseCP/FuseCP
Multi Server Control Panel for Windows based on C#
Version Downloads Last Updated
6.0.0 9,739 4/15/2026
5.0.0 1,877 3/27/2026
4.0.7 15,831 1/6/2026
4.0.0 3,991 11/17/2025
3.3.12 9,875 5/28/2025
3.3.0 20,942 12/10/2024
3.2.0 780 12/9/2024
3.1.0 25,552 2/5/2024
3.0.0 6,927 11/3/2023
2.5.2 22,799 6/30/2022
2.4.0 12,468 9/27/2021
2.3.1 545 9/27/2021
2.2.2 10,078 3/1/2021
2.1.10 10,032 9/15/2020
2.1.9 1,700 6/16/2020
2.1.6 851 5/14/2020
2.1.4 2,275 3/10/2020
2.0.23 954 3/4/2020
Loading failed