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