150 references to ErrorUtilities
MSBuild (150)
AssemblyLoadInfo.cs (4)
27ErrorUtilities.VerifyThrow((!string.IsNullOrEmpty(assemblyName)) || (!string.IsNullOrEmpty(assemblyFile)), 29ErrorUtilities.VerifyThrow((assemblyName == null) || (assemblyFile == null), 102ErrorUtilities.VerifyThrow(translator.Mode == TranslationDirection.WriteToStream, "write only"); 179ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
AssemblyNameExtension.cs (3)
327ErrorUtilities.VerifyThrow(!immutable, "Object is immutable cannot replace the version"); 384ErrorUtilities.VerifyThrow(extensionToAdd.Immutable, "ExtensionToAdd is not immutable"); 515ErrorUtilities.VerifyThrow(result == baselineResult, "Optimized version of CompareBaseNameTo didn't return the same result as the baseline.");
AssemblyResources.cs (1)
33ErrorUtilities.VerifyThrow(resource != null, "Missing resource '{0}'", name);
CommandLineSwitchException.cs (2)
57ErrorUtilities.VerifyThrowArgumentNull(info, nameof(info)); 152ErrorUtilities.VerifyThrow(errorMessage != null, "The resource string must exist.");
CommunicationsUtilities.cs (5)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 624ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method."); 625ErrorUtilities.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method."); 641ErrorUtilities.ThrowInternalErrorUnreachable(); 675ErrorUtilities.ThrowInternalErrorUnreachable();
ConversionUtilities.cs (3)
7using Error = Microsoft.Build.Shared.ErrorUtilities; 38Error.ThrowArgument("Shared.CannotConvertStringToBool", parameterValue); 147Error.ThrowInternalError("Cannot numeric evaluate");
EventArgsFormatting.cs (5)
72ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); 89ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); 105ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); 122ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); 151ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
FileUtilities.cs (10)
191ErrorUtilities.ThrowArgument("DebugPathTooLong", directory); 392ErrorUtilities.VerifyThrowInternalLength(path, nameof(path)); 393ErrorUtilities.VerifyThrow(trailingSegmentsToKeep >= 0, "trailing segments must be positive"); 464ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path)); 1128ErrorUtilities.VerifyThrowArgumentNull(basePath, nameof(basePath)); 1129ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path)); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1266ErrorUtilities.VerifyThrowArgumentNull(root, nameof(root)); 1267ErrorUtilities.VerifyThrowArgumentNull(paths, nameof(paths)); 1477ErrorUtilities.ThrowArgument("InvalidGetPathOfFileAboveParameter", file);
InitializationException.cs (4)
62ErrorUtilities.VerifyThrowArgumentNull(info, nameof(info)); 145ErrorUtilities.VerifyThrow(errorMessage != null, "The resource string must exist."); 169ErrorUtilities.VerifyThrow(errorMessage != null, "The resource string must exist."); 186ErrorUtilities.VerifyThrow(message != null, "The string must exist.");
InterningBinaryReader.cs (3)
14using ErrorUtilities = Microsoft.Build.Shared.ErrorUtilities; 126ErrorUtilities.ThrowInternalError("From calculating based on the memorystream, about to read n = {0}. length = {1}, rawPosition = {2}, readLength = {3}, stringLength = {4}, currPos = {5}.", n, length, rawPosition, readLength, stringLength, currPos); 141ErrorUtilities.ThrowInternalError("From getting the length out of BaseStream.Read directly, about to read n = {0}. readLength = {1}, stringLength = {2}, currPos = {3}", n, readLength, stringLength, currPos);
JsonOutputFormatter.cs (4)
35ErrorUtilities.VerifyThrow(_topLevelNode["Properties"] is null, "Should not add multiple lists of properties to the json format."); 53ErrorUtilities.VerifyThrow(_topLevelNode["Items"] is null, "Should not add multiple lists of items to the json format."); 89ErrorUtilities.VerifyThrow(_topLevelNode["Items"] is null, "Should not add multiple lists of items to the json format."); 130ErrorUtilities.VerifyThrow(_topLevelNode["TargetResults"] is null, "Should not add multiple lists of target results to the json format.");
LoadedType.cs (3)
32ErrorUtilities.VerifyThrow(type != null, "We must have the type."); 33ErrorUtilities.VerifyThrow(assemblyLoadInfo != null, "We must have the assembly the type was loaded from."); 34ErrorUtilities.VerifyThrow(loadedAssembly is not null, "The assembly should always be loaded even if only by MetadataLoadContext.");
LogMessagePacketBase.cs (3)
318ErrorUtilities.VerifyThrow(nodeBuildEvent != null, "nodeBuildEvent was null"); 519ErrorUtilities.VerifyThrow(_buildEvent is not null, "Not Supported LoggingEventType {0}", _eventType.ToString()); 886ErrorUtilities.ThrowInternalError("Not Supported LoggingEventType {0}", eventType.ToString());
Modifiers.cs (8)
385ErrorUtilities.VerifyThrow(itemSpec != null, "Need item-spec to modify."); 386ErrorUtilities.VerifyThrow(modifier != null, "Need modifier to apply to item-spec."); 417ErrorUtilities.VerifyThrow(FileUtilitiesRegex.StartsWithUncPattern(modifiedItemSpec), 478ErrorUtilities.VerifyThrow((modifiedItemSpec.Length > length) && IsSlash(modifiedItemSpec[length]), 486ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(modifiedItemSpec) && IsSlash(modifiedItemSpec[0]), 588ErrorUtilities.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier); 597ErrorUtilities.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier); 602ErrorUtilities.ThrowInvalidOperation("Shared.InvalidFilespecForTransform", modifier, itemSpec, e.Message);
MSBuildNameIgnoreCaseComparer.cs (2)
49ErrorUtilities.ThrowInternalError("Invalid lengthToCompare '{0}' {1} {2}", constrainedString, start, lengthToCompare); 54ErrorUtilities.ThrowInternalError("Invalid start '{0}' {1} {2}", constrainedString, start, lengthToCompare);
NodeEndpointOutOfProcBase.cs (9)
154ErrorUtilities.VerifyThrow(_status == LinkStatus.Inactive, "Link not inactive. Status is {0}", _status); 155ErrorUtilities.VerifyThrowArgumentNull(factory, nameof(factory)); 167ErrorUtilities.ThrowInternalError("Connect() not valid on the out of proc endpoint."); 273ErrorUtilities.VerifyThrow(_status != newStatus, "Attempting to change status to existing status {0}.", _status); 296ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread."); 317ErrorUtilities.VerifyThrowArgumentNull(packet, nameof(packet)); 318ErrorUtilities.VerifyThrow(_packetQueue != null, "packetQueue is null"); 319ErrorUtilities.VerifyThrow(_packetAvailable != null, "packetAvailable is null"); 669ErrorUtilities.ThrowInternalError("waitId {0} out of range.", waitId);
NodePacketFactory.cs (1)
55ErrorUtilities.ThrowInternalError("No packet handler for type {0}", packetType);
OutOfProcTaskHostNode.cs (14)
217ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!"); 229ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!"); 241ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!"); 253ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!"); 539ErrorUtilities.VerifyThrow(_taskHost._currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!"); 722ErrorUtilities.VerifyThrow(!_isTaskExecuting, "Why are we getting a TaskHostConfiguration packet while we're still executing a task?"); 736ErrorUtilities.VerifyThrow(!_isTaskExecuting, "The task should be done executing before CompleteTask."); 743ErrorUtilities.VerifyThrowInternalNull(_taskCompletePacket, "taskCompletePacket"); 798ErrorUtilities.VerifyThrow(!_isTaskExecuting, "We should never have a task in the process of executing when we receive NodeBuildComplete."); 1016ErrorUtilities.VerifyThrowInternalNull(s_mismatchedEnvironmentValues, "mismatchedEnvironmentValues"); 1079ErrorUtilities.VerifyThrowInternalNull(s_mismatchedEnvironmentValues, "mismatchedEnvironmentValues"); 1207ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration when we're trying to log messages!"); 1224ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration when we're trying to log warnings!"); 1247ErrorUtilities.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration when we're trying to log errors!");
OutOfProcTaskHostTaskResult.cs (3)
65ErrorUtilities.VerifyThrowInternalNull(taskException, nameof(taskException)); 70ErrorUtilities.VerifyThrow( 79ErrorUtilities.VerifyThrow(exceptionMessage != null, "If we have message args, we need a message.");
PrintLineDebugger.cs (4)
30ErrorUtilities.VerifyThrowInternalNull(propertyInfo, nameof(propertyInfo)); 77ErrorUtilities.ThrowInternalError("Cannot set a new writer over an old writer. Remove the old one first"); 99ErrorUtilities.ThrowInternalError("Cannot unset an already null writer"); 161ErrorUtilities.ThrowInternalError($"The writer from this {nameof(PrintLineDebugger)} instance differs from the static writer.");
QuotingUtilities.cs (2)
72ErrorUtilities.VerifyThrow(maxSplits >= 2, "There is no point calling this method for less than two splits."); 76ErrorUtilities.VerifyThrow(separators.IndexOf('"') == -1, "The double-quote character is not supported as a separator.");
ReadOnlyEmptyCollection.cs (3)
87ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 95ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 118ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
ReadOnlyEmptyDictionary.cs (6)
176ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 185ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 201ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 219ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 227ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection"); 250ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
ReflectableTaskPropertyInfo.cs (2)
37ErrorUtilities.VerifyThrowArgumentNull(taskType, nameof(taskType)); 81ErrorUtilities.VerifyThrow(_propertyInfo != null, "Could not find property {0} on type {1} that the task factory indicated should exist.", Name, _taskType.FullName);
ResourceUtilities.cs (6)
42ErrorUtilities.VerifyThrowInternalNull(message, nameof(message)); 243ErrorUtilities.ThrowInternalError("Invalid resource parameter type, was {0}", 275ErrorUtilities.ThrowInternalError("The resource string \"" + resourceName + "\" was not found."); 283ErrorUtilities.ThrowInternalError(e.Message); 290ErrorUtilities.ThrowInternalError(e.Message); 297ErrorUtilities.ThrowInternalError(e.Message);
StringExtensions.cs (3)
18ErrorUtilities.VerifyThrowArgumentNull(aString, nameof(aString)); 19ErrorUtilities.VerifyThrowArgumentNull(oldValue, nameof(oldValue)); 20ErrorUtilities.VerifyThrowArgumentLength(oldValue, nameof(oldValue));
TaskHostConfiguration.cs (2)
166ErrorUtilities.VerifyThrowInternalLength(taskName, nameof(taskName)); 167ErrorUtilities.VerifyThrowInternalLength(taskLocation, nameof(taskLocation));
TaskHostTaskComplete.cs (1)
108ErrorUtilities.VerifyThrowInternalNull(result, nameof(result));
TaskParameter.cs (13)
115ErrorUtilities.VerifyThrow( 152ErrorUtilities.ThrowInternalErrorUnreachable(); 187ErrorUtilities.ThrowInternalErrorUnreachable(); 272ErrorUtilities.ThrowInternalErrorUnreachable(); 410ErrorUtilities.VerifyThrow(translator.Mode == TranslationDirection.WriteToStream, "Cannot call this method when reading!"); 477ErrorUtilities.VerifyThrow(translator.Mode == TranslationDirection.ReadFromStream, "Cannot call this method when writing!"); 771ErrorUtilities.VerifyThrowInternalNull(escapedItemSpec, nameof(escapedItemSpec)); 862ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName)); 866ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName); 879ErrorUtilities.VerifyThrowArgumentNull(metadataName, nameof(metadataName)); 880ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName); 902ErrorUtilities.VerifyThrowArgumentNull(destinationItem, nameof(destinationItem)); 969ErrorUtilities.VerifyThrowArgumentNull(metadataName, nameof(metadataName));
TempFileUtilities.cs (2)
162ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(directory, nameof(directory)); 188ErrorUtilities.VerifyThrow(!FileSystems.Default.FileExists(file), "Guid should be unique");
TerminalLogger\TerminalLogger.cs (1)
307ErrorUtilities.VerifyThrowArgumentNull(parameterName, nameof(parameterName));
TypeLoader.cs (4)
70ErrorUtilities.VerifyThrow(isDesiredType != null, "need a type filter"); 309ErrorUtilities.VerifyThrowArgumentNull(typeFilter, "typefilter"); 310ErrorUtilities.VerifyThrowArgumentNull(loadInfo, nameof(loadInfo)); 324ErrorUtilities.VerifyThrowArgumentNull(typeName, nameof(typeName));
XMake.cs (10)
1678ErrorUtilities.VerifyThrow(ex.HasBeenLogged, "Should have been logged"); 2117ErrorUtilities.VerifyThrow(switchName == unquotedSwitchIndicatorAndName.Substring(switchIndicatorsLength), 2120ErrorUtilities.VerifyThrow(doubleQuotesRemovedFromArg >= doubleQuotesRemovedFromSwitchIndicatorAndName, 2149ErrorUtilities.VerifyThrow(switchParameters != null, "We must be able to extract the switch parameters."); 2762ErrorUtilities.VerifyThrow(!invokeBuild || !string.IsNullOrEmpty(projectFile), "We should have a project file if we're going to build."); 2987ErrorUtilities.VerifyThrow(projectSwitchParameters.Length <= 1, "Expect exactly one project at a time."); 3474ErrorUtilities.VerifyThrow(parameters.Length <= 1, "Expect exactly one project at a time."); 4217ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4263ErrorUtilities.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2), 4279ErrorUtilities.VerifyThrow(loggerTypeSpec.Count >= 1, "SplitUnquoted() must return at least one string");
XMakeAttributes.cs (4)
170ErrorUtilities.VerifyThrow(runtimeA != String.Empty && runtimeB != String.Empty, "We should never get an empty string passed to this method"); 214ErrorUtilities.VerifyThrow(runtimeA != String.Empty && runtimeB != String.Empty, "We should never get an empty string passed to this method"); 287ErrorUtilities.VerifyThrow(architectureA != String.Empty && architectureB != String.Empty, "We should never get an empty string passed to this method"); 354ErrorUtilities.VerifyThrow(architectureA != String.Empty && architectureB != String.Empty, "We should never get an empty string passed to this method");