Popular: Data updated November 25, 2026

Categories

Internet1,425
Communication330
Audio & video941
Graphics & design570
Office & productivity1,192
Developer tools3,303
AI tools614
Security & privacy410
System tools3,210
Games545
Education & science242
Network & IT296

.NET CodeContracts silent install & uninstall

Provides a language-agnostic way to express coding assumptions in .NET programs.

Commands for installing .NET CodeContracts without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.

Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell

With winget

PowerShell
winget install --id Microsoft.DotNet.CodeContracts -e --silent --accept-package-agreements --accept-source-agreements
winget upgrade --id Microsoft.DotNet.CodeContracts -e --silent
winget uninstall --id Microsoft.DotNet.CodeContracts -e --silent

By installer

32-bit · MSI · en-US

Silent installmsiexec /i Contracts.devlab9ts.msi /qn /norestart
Write a logmsiexec /i Contracts.devlab9ts.msi /qn /norestart /l*v "%TEMP%\net-codecontracts-install.log"
Uninstallmsiexec /x {4ED22F53-768D-4286-9F55-4927F1D67B4F} /qn /norestart
MSI product code
{4ED22F53-768D-4286-9F55-4927F1D67B4F}
Uninstall registry key
HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4ED22F53-768D-4286-9F55-4927F1D67B4F}

PowerShell: download, verify, install

Downloads the official file, checks its SHA256 and installs it silently.

install-net-codecontracts.ps1
$url = 'https://github.com/microsoft/CodeContracts/releases/download/v1.10.20606.1/Contracts.devlab9ts.msi'
$sha256 = '5A2E44751A650A8442DFE1A41484E960B46EAA1A55B25672F6537A1D59015F5B'
$file = Join-Path $env:TEMP 'Contracts.devlab9ts.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait

More from Microsoft Corporation

See all
  • PowerShellPowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS.
  • PowerToysMicrosoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity.
  • NuGetThe package manager for .NET
  • Microsoft Azure CLIThe Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation.
  • OpenSSH PreviewMicrosoft.OpenSSH.Preview
  • Bicep CLIA declarative language for describing and deploying Azure resources

Tags

Share