Skip to main content
net6.0.NETStandard2.0

Common input validation and state verification utility methods.

Published
Jan 27, 2023
3y ago
Total Downloads
148.8M
148,834,822

Install

dotnet add package Microsoft.VisualStudio.Validation --version 17.6.4-alpha
ProductVersions
.NET
net6.0
.NET Standard
netstandard2.0

README

Microsoft.VisualStudio.Validation

NuGet package Build Status codecov

This project is available as the Microsoft.VisualStudio.Validation NuGet package.

Basic input validation via the Requires class throws an ArgumentException.

Requires.NotNull(arg1, nameof(arg1));
Requires.NotNullOrEmpty(arg2, nameof(arg2));

State validation via the Verify class throws an InvalidOperationException.

Verify.Operation(condition, "some error occurred.");

Internal integrity checks via the Assumes class throws an InternalErrorException.

Assumes.True(condition, "some error");

Warning signs that should not throw exceptions via the Report class.

Report.IfNot(condition, "some error");

Changes from Previous Version

v17.0.71v17.6.4-alpha
Added Frameworks
net6.0

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.