154 references to ErrorUtilities
MSBuild (154)
AssemblyLoadInfo.cs (4)
27
ErrorUtilities
.VerifyThrow((!string.IsNullOrEmpty(assemblyName)) || (!string.IsNullOrEmpty(assemblyFile)),
29
ErrorUtilities
.VerifyThrow((assemblyName == null) || (assemblyFile == null),
110
ErrorUtilities
.VerifyThrow(translator.Mode == TranslationDirection.WriteToStream, "write only");
196
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);
CommandLine\CommandLineParser.cs (4)
549
ErrorUtilities
.VerifyThrow(projectSwitchParameters.Length <= 1, "Expect exactly one project at a time.");
600
ErrorUtilities
.VerifyThrow(switchName == unquotedSwitchIndicatorAndName.Substring(switchIndicatorsLength),
603
ErrorUtilities
.VerifyThrow(doubleQuotesRemovedFromArg >= doubleQuotesRemovedFromSwitchIndicatorAndName,
632
ErrorUtilities
.VerifyThrow(switchParameters != null, "We must be able to extract the switch parameters.");
CommandLine\CommandLineSwitchException.cs (2)
57
ErrorUtilities
.VerifyThrowArgumentNull(info);
152
ErrorUtilities
.VerifyThrow(errorMessage != null, "The resource string must exist.");
CommunicationsUtilities.cs (7)
261
ErrorUtilities
.VerifyThrow(
520
ErrorUtilities
.VerifyThrowInternalNull(DebugUtils.ProcessInfoString, nameof(DebugUtils.DebugPath));
749
ErrorUtilities
.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes");
965
ErrorUtilities
.VerifyThrow(taskHostParameters.Runtime != null, "Should always have an explicit runtime when we call this method.");
966
ErrorUtilities
.VerifyThrow(taskHostParameters.Architecture != null, "Should always have an explicit architecture when we call this method.");
982
ErrorUtilities
.ThrowInternalErrorUnreachable();
1016
ErrorUtilities
.ThrowInternalErrorUnreachable();
ConversionUtilities.cs (3)
9
using Error = Microsoft.Build.Shared.
ErrorUtilities
;
40
Error
.ThrowArgument("Shared.CannotConvertStringToBool", parameterValue);
159
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);
FrameworkLocationHelper.cs (12)
670
ErrorUtilities
.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
680
ErrorUtilities
.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
705
ErrorUtilities
.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
715
ErrorUtilities
.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
1013
ErrorUtilities
.VerifyThrowArgumentNull(targetFrameworkRootPath);
1014
ErrorUtilities
.VerifyThrowArgumentNull(frameworkName);
1028
ErrorUtilities
.ThrowInvalidOperation("FrameworkLocationHelper.CouldNotGenerateReferenceAssemblyDirectory", targetFrameworkRootPath, frameworkName.ToString(), e.Message);
1042
ErrorUtilities
.VerifyThrowArgumentOutOfRange(numberOfLevelsToRemove > 0, nameof(numberOfLevelsToRemove));
1157
ErrorUtilities
.VerifyThrowArgument(VisualStudioSpecDict.Value.TryGetValue(version, out VisualStudioSpec spec), "FrameworkLocationHelper.UnsupportedVisualStudioVersion", version);
1163
ErrorUtilities
.VerifyThrowArgument(DotNetFrameworkSpecDict.Value.TryGetValue(version, out DotNetFrameworkSpec spec), "FrameworkLocationHelper.UnsupportedFrameworkVersion", version);
1593
ErrorUtilities
.VerifyThrowArgument(this._visualStudioVersion != null, "FrameworkLocationHelper.UnsupportedFrameworkVersionForWindowsSdk", this.Version);
1599
ErrorUtilities
.ThrowArgument("FrameworkLocationHelper.UnsupportedFrameworkVersionForWindowsSdk", this.Version);
InitializationException.cs (5)
62
ErrorUtilities
.VerifyThrowArgumentNull(info);
145
ErrorUtilities
.VerifyThrow(errorMessage != null, "The resource string must exist.");
167
ErrorUtilities
.VerifyThrow(errorMessage != null, "The resource string must exist.");
191
ErrorUtilities
.VerifyThrow(errorMessage != null, "The resource string must exist.");
208
ErrorUtilities
.VerifyThrow(message != null, "The string must exist.");
InterningBinaryReader.cs (3)
11
using ErrorUtilities = Microsoft.Build.Shared.
ErrorUtilities
;
121
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);
136
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)
39
ErrorUtilities
.VerifyThrow(type != null, "We must have the type.");
40
ErrorUtilities
.VerifyThrow(assemblyLoadInfo != null, "We must have the assembly the type was loaded from.");
41
ErrorUtilities
.VerifyThrow(loadedAssembly is not null, "The assembly should always be loaded even if only by MetadataLoadContext.");
LogMessagePacketBase.cs (5)
294
ErrorUtilities
.VerifyThrow(nodeBuildEvent != null, "nodeBuildEvent was null");
381
ErrorUtilities
.VerifyThrow(_eventType != LoggingEventType.CustomEvent, "_eventType should not be a custom event");
422
ErrorUtilities
.VerifyThrow(_eventType != LoggingEventType.CustomEvent, "_eventType should not be a custom event");
443
ErrorUtilities
.VerifyThrow(_buildEvent is not null, "Not Supported LoggingEventType {0}", _eventType.ToString());
771
ErrorUtilities
.ThrowInternalError("Not Supported LoggingEventType {0}", eventType.ToString());
NodeEndpointOutOfProcBase.cs (9)
172
ErrorUtilities
.VerifyThrow(_status == LinkStatus.Inactive, "Link not inactive. Status is {0}", _status);
173
ErrorUtilities
.VerifyThrowArgumentNull(factory, nameof(factory));
185
ErrorUtilities
.ThrowInternalError("Connect() not valid on the out of proc endpoint.");
292
ErrorUtilities
.VerifyThrow(_status != newStatus, "Attempting to change status to existing status {0}.", _status);
315
ErrorUtilities
.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
332
ErrorUtilities
.VerifyThrowArgumentNull(packet, nameof(packet));
333
ErrorUtilities
.VerifyThrow(_packetQueue != null, "packetQueue is null");
334
ErrorUtilities
.VerifyThrow(_packetAvailable != null, "packetAvailable is null");
801
ErrorUtilities
.ThrowInternalError("waitId {0} out of range.", waitId);
NodePacketFactory.cs (3)
55
ErrorUtilities
.ThrowInternalError("No packet handler for type {0}", packetType);
70
ErrorUtilities
.ThrowInternalError("No packet handler for type {0}", packetType);
84
ErrorUtilities
.ThrowInternalError("No packet handler for type {0}", packet.Type);
OutOfProcTaskHostNode.cs (17)
243
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!");
255
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!");
267
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!");
279
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!");
538
ErrorUtilities
.VerifyThrowArgumentOutOfRange(requestedCores > 0, nameof(requestedCores));
554
ErrorUtilities
.VerifyThrowArgumentOutOfRange(coresToRelease > 0, nameof(coresToRelease));
589
ErrorUtilities
.VerifyThrow(_taskHost._currentConfiguration != null, "We should never have a null configuration during a BuildEngine callback!");
789
ErrorUtilities
.ThrowInternalError("HandleCallbackResponse called with non-callback packet type: {0}", packet.GetType().Name);
866
ErrorUtilities
.VerifyThrow(!_isTaskExecuting, "Why are we getting a TaskHostConfiguration packet while we're still executing a task?");
880
ErrorUtilities
.VerifyThrow(!_isTaskExecuting, "The task should be done executing before CompleteTask.");
887
ErrorUtilities
.VerifyThrowInternalNull(_taskCompletePacket, "taskCompletePacket");
942
ErrorUtilities
.VerifyThrow(!_isTaskExecuting, "We should never have a task in the process of executing when we receive NodeBuildComplete.");
1178
ErrorUtilities
.VerifyThrowInternalNull(s_mismatchedEnvironmentValues, "mismatchedEnvironmentValues");
1241
ErrorUtilities
.VerifyThrowInternalNull(s_mismatchedEnvironmentValues, "mismatchedEnvironmentValues");
1369
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration when we're trying to log messages!");
1386
ErrorUtilities
.VerifyThrow(_currentConfiguration != null, "We should never have a null configuration when we're trying to log warnings!");
1409
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)
32
ErrorUtilities
.VerifyThrowInternalNull(propertyInfo);
83
ErrorUtilities
.ThrowInternalError("Cannot set a new writer over an old writer. Remove the old one first");
105
ErrorUtilities
.ThrowInternalError("Cannot unset an already null writer");
169
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)
70
ErrorUtilities
.VerifyThrow(maxSplits >= 2, "There is no point calling this method for less than two splits.");
74
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)
166
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
175
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
191
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
209
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
217
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
240
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)
39
ErrorUtilities
.VerifyThrowInternalNull(message);
428
ErrorUtilities
.ThrowInternalError(
454
ErrorUtilities
.ThrowInternalError("The resource string \"" + resourceName + "\" was not found.");
462
ErrorUtilities
.ThrowInternalError(e.Message);
469
ErrorUtilities
.ThrowInternalError(e.Message);
476
ErrorUtilities
.ThrowInternalError(e.Message);
StringExtensions.cs (3)
18
ErrorUtilities
.VerifyThrowArgumentNull(aString);
19
ErrorUtilities
.VerifyThrowArgumentNull(oldValue);
20
ErrorUtilities
.VerifyThrowArgumentLength(oldValue);
TaskHostConfiguration.cs (2)
187
ErrorUtilities
.VerifyThrowInternalLength(taskName, nameof(taskName));
188
ErrorUtilities
.VerifyThrowInternalLength(taskLocation, nameof(taskLocation));
TaskHostTaskComplete.cs (1)
108
ErrorUtilities
.VerifyThrowInternalNull(result);
TaskParameter.cs (13)
117
ErrorUtilities
.VerifyThrow(
154
ErrorUtilities
.ThrowInternalErrorUnreachable();
189
ErrorUtilities
.ThrowInternalErrorUnreachable();
260
ErrorUtilities
.ThrowInternalErrorUnreachable();
610
ErrorUtilities
.VerifyThrowInternalNull(_escapedItemSpec);
705
ErrorUtilities
.VerifyThrowArgumentLength(metadataName);
709
ErrorUtilities
.VerifyThrowArgument(!ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName);
722
ErrorUtilities
.VerifyThrowArgumentNull(metadataName);
723
ErrorUtilities
.VerifyThrowArgument(!ItemSpecModifiers.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName);
745
ErrorUtilities
.VerifyThrowArgumentNull(destinationItem);
828
ErrorUtilities
.VerifyThrowArgumentNull(metadataName);
931
ErrorUtilities
.VerifyThrowInternalNull(_escapedItemSpec);
932
ErrorUtilities
.VerifyThrowInternalNull(_customEscapedMetadata);
TypeLoader.cs (4)
119
ErrorUtilities
.VerifyThrow(isDesiredType != null, "need a type filter");
422
ErrorUtilities
.VerifyThrowArgumentNull(typeFilter, "typefilter");
423
ErrorUtilities
.VerifyThrowArgumentNull(loadInfo);
441
ErrorUtilities
.VerifyThrowArgumentNull(typeName);
XMake.cs (7)
661
ErrorUtilities
.VerifyThrowArgumentLength(commandLine);
1729
ErrorUtilities
.VerifyThrow(ex.HasBeenLogged, "Should have been logged");
2357
ErrorUtilities
.VerifyThrow(!invokeBuild || !string.IsNullOrEmpty(projectFile), "We should have a project file if we're going to build.");
3099
ErrorUtilities
.VerifyThrow(parameters.Length <= 1, "Expect exactly one project at a time.");
3854
ErrorUtilities
.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2),
3900
ErrorUtilities
.VerifyThrow((loggerSpec.Count >= 1) && (loggerSpec.Count <= 2),
3916
ErrorUtilities
.VerifyThrow(loggerTypeSpec.Count >= 1, "SplitUnquoted() must return at least one string");
XMakeAttributes.cs (4)
162
ErrorUtilities
.VerifyThrow(runtimeA != String.Empty && runtimeB != String.Empty, "We should never get an empty string passed to this method");
206
ErrorUtilities
.VerifyThrow(runtimeA != String.Empty && runtimeB != String.Empty, "We should never get an empty string passed to this method");
279
ErrorUtilities
.VerifyThrow(architectureA != String.Empty && architectureB != String.Empty, "We should never get an empty string passed to this method");
346
ErrorUtilities
.VerifyThrow(architectureA != String.Empty && architectureB != String.Empty, "We should never get an empty string passed to this method");