System requirement validation and resolution for autorest.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
.NET runtime detection and version validation for AutoRest .NET-based extensions. Provides .NET availability checking with version detection using the dotnet --version command.
Resolves .NET runtime requirements by executing dotnet --version and validating the version output.
/**
* Resolve .NET runtime requirement
* @param requirement - .NET requirement configuration
* @returns Resolution with dotnet command and version, or error details
*/
function resolveDotnetRequirement(
requirement: SystemRequirement
): Promise<SystemRequirementResolution | SystemRequirementError>;Usage Example:
import { resolveDotnetRequirement } from "@autorest/system-requirements";
// Basic .NET requirement
const result = await resolveDotnetRequirement({ version: ">=5.0" });
if ("error" in result) {
console.error(".NET not found or version incompatible:", result.message);
} else {
console.log(`.NET resolved: ${result.command}`);
console.log(`.NET name: ${result.name}`); // "dotnet"
}
// Using custom .NET path via environment variable
const customResult = await resolveDotnetRequirement({
version: ">=6.0",
environmentVariable: "DOTNET_ROOT"
});The .NET resolver follows this detection process:
environmentVariable is specified in the requirement, uses that pathdotnet command in system PATHdotnet --version to get version string.NET version detection uses the dotnet --version command output, which returns the version string directly:
6.0.100The version string is used as-is for semantic version comparison.
/** .NET executable name used in system requirement resolution */
const DotnetExeName = "dotnet";Common .NET resolution errors include:
dotnet executable is not in PATH and no environment variable specifieddotnet --version command failed to executeThe resolver provides detailed error messages to help diagnose .NET installation and configuration issues.
The resolver supports all .NET versions that respond to the --version flag:
dotnet command is available (less common)Version requirements follow semantic versioning rules, so you can specify:
"5.0.100"">=6.0"">=5.0 <7.0"