179 references to ErrorUtilities
Microsoft.Build.Tasks.Core (170)
AppConfig\BindingRedirect.cs (4)
40
ErrorUtilities
.VerifyThrowArgument(!String.IsNullOrEmpty(oldVersion), "AppConfig.BindingRedirectMissingOldVersion");
65
ErrorUtilities
.ThrowArgument(e, "AppConfig.InvalidOldVersionAttribute", e.Message);
71
ErrorUtilities
.VerifyThrowArgument(!String.IsNullOrEmpty(newVersionAttribute), "AppConfig.BindingRedirectMissingNewVersion");
79
ErrorUtilities
.ThrowArgument(e, "AppConfig.InvalidNewVersionAttribute", e.Message);
AppConfig\DependentAssembly.cs (1)
99
ErrorUtilities
.ThrowArgument(e, "AppConfig.InvalidAssemblyIdentityFields");
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
130
ErrorUtilities
.VerifyThrow(FileSystems.Default.FileExists(_assemblyFolderConfigFile),
AssemblyDependency\AssemblyInformation.cs (1)
71
ErrorUtilities
.VerifyThrowArgumentNull(sourceFile);
AssemblyDependency\GenerateBindingRedirects.cs (2)
195
ErrorUtilities
.VerifyThrow(runtimeNode != null, "This should not be called if the \"runtime\" node is missing.");
361
ErrorUtilities
.VerifyThrow(SuggestedRedirects?.Length > 0, "This should not be called if there is no suggested redirect.");
AssemblyDependency\Reference.cs (4)
621
ErrorUtilities
.VerifyThrow(
623
ErrorUtilities
.VerifyThrow(
747
ErrorUtilities
.VerifyThrow(remappedFrom.Immutable, " Remapped from is NOT immutable");
748
ErrorUtilities
.VerifyThrow(remappedTo.Immutable, " Remapped to is NOT immutable");
AssemblyDependency\ReferenceTable.cs (8)
416
ErrorUtilities
.VerifyThrow(assemblyName.Name != null, "Got an empty assembly name.");
441
ErrorUtilities
.VerifyThrow(assemblyName.Name != null, "Got an empty assembly name.");
1666
ErrorUtilities
.VerifyThrow(dependencyIterations < maxIterations, "Maximum iterations exceeded while looking for dependencies.");
1685
ErrorUtilities
.VerifyThrow(moreResolvableIterations < maxIterations, "Maximum iterations exceeded while looking for resolvable references.");
2341
ErrorUtilities
.VerifyThrow(assemblyReference0.assemblyName.FullName != null, "Got a null assembly name fullname. (0)");
2342
ErrorUtilities
.VerifyThrow(assemblyReference1.assemblyName.FullName != null, "Got a null assembly name fullname. (1)");
2547
ErrorUtilities
.VerifyThrowInternalNull(a);
2548
ErrorUtilities
.VerifyThrowInternalNull(b);
AssemblyDependency\ResolveAssemblyReference.cs (8)
347
ErrorUtilities
.VerifyThrowArgumentNull(value, "TargetFrameworkSubsets");
497
ErrorUtilities
.VerifyThrowArgumentNull(value, "InstalledAssemblySubsetTables");
528
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullFrameworkAssemblyTables");
880
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullTargetFrameworkSubsetNames");
898
ErrorUtilities
.VerifyThrowArgumentNull(value, "profileName");
917
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullFrameworkFolders");
1360
ErrorUtilities
.VerifyThrowInternalNull(conflictCandidate);
1790
ErrorUtilities
.VerifyThrowArgumentNull(reference);
AssemblyFoldersFromConfig.cs (2)
32
ErrorUtilities
.VerifyThrowArgumentNull(configFile);
33
ErrorUtilities
.VerifyThrowArgumentNull(targetRuntimeVersion);
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)
27
ErrorUtilities
.VerifyThrow(resource != null, "Missing resource '{0}'", name);
CombinePath.cs (1)
37
ErrorUtilities
.VerifyThrowArgumentNull(_paths, nameof(Paths));
CommandLineBuilderExtension.cs (1)
236
ErrorUtilities
.VerifyThrow(
CommunicationsUtilities.cs (6)
335
ErrorUtilities
.VerifyThrowInternalNull(DebugUtils.ProcessInfoString, nameof(DebugUtils.DebugPath));
581
ErrorUtilities
.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes");
737
ErrorUtilities
.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.runtime, out string runtimeVersion), "Should always have an explicit runtime when we call this method.");
738
ErrorUtilities
.VerifyThrow(taskHostParameters.TryGetValue(XMakeAttributes.architecture, out string architecture), "Should always have an explicit architecture when we call this method.");
754
ErrorUtilities
.ThrowInternalErrorUnreachable();
788
ErrorUtilities
.ThrowInternalErrorUnreachable();
ConversionUtilities.cs (3)
9
using Error = Microsoft.Build.Shared.
ErrorUtilities
;
40
Error
.ThrowArgument("Shared.CannotConvertStringToBool", parameterValue);
159
Error
.ThrowInternalError("Cannot numeric evaluate");
ConvertToAbsolutePath.cs (1)
29
ErrorUtilities
.VerifyThrowArgumentNull(_paths, nameof(Paths));
CreateManifestResourceName.cs (4)
55
ErrorUtilities
.VerifyThrowArgumentNull(_resourceFiles, nameof(ResourceFiles));
309
ErrorUtilities
.VerifyThrowArgumentNull(subName);
347
ErrorUtilities
.VerifyThrowArgumentNull(name);
379
ErrorUtilities
.VerifyThrowArgumentNull(name);
Delete.cs (1)
32
ErrorUtilities
.VerifyThrowArgumentNull(_files, nameof(Files));
ExtensionFoldersRegistryKey.cs (2)
20
ErrorUtilities
.VerifyThrowArgumentNull(registryKey);
21
ErrorUtilities
.VerifyThrowArgumentNull(targetFrameworkVersion);
FileMatcher.cs (8)
237
ErrorUtilities
.ThrowInternalError("Unexpected filesystem entity type.");
455
ErrorUtilities
.VerifyThrow(!HasWildcards(path),
521
ErrorUtilities
.VerifyThrow(entries.Count == 1,
845
ErrorUtilities
.VerifyThrow((recursionState.SearchData.Filespec == null) || (recursionState.SearchData.RegexFileMatch == null),
848
ErrorUtilities
.VerifyThrow((recursionState.SearchData.Filespec != null) || (recursionState.SearchData.RegexFileMatch != null),
851
ErrorUtilities
.VerifyThrow(recursionState.RemainingWildcardDirectory != null, "Expected non-null remaning wildcard directory.");
1187
ErrorUtilities
.VerifyThrow(
1667
ErrorUtilities
.ThrowInternalError("Unexpected empty 'input' provided.");
FileState.cs (2)
130
ErrorUtilities
.ThrowInternalErrorUnreachable();
250
ErrorUtilities
.VerifyThrowArgumentLength(filename);
FileUtilities.cs (10)
204
ErrorUtilities
.ThrowArgument("DebugPathTooLong", directory);
413
ErrorUtilities
.VerifyThrowInternalLength(path, nameof(path));
414
ErrorUtilities
.VerifyThrow(trailingSegmentsToKeep >= 0, "trailing segments must be positive");
485
ErrorUtilities
.VerifyThrowArgumentLength(path);
1168
ErrorUtilities
.VerifyThrowArgumentNull(basePath);
1169
ErrorUtilities
.VerifyThrowArgumentLength(path);
1177
ErrorUtilities
.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes.");
1306
ErrorUtilities
.VerifyThrowArgumentNull(root);
1307
ErrorUtilities
.VerifyThrowArgumentNull(paths);
1517
ErrorUtilities
.ThrowArgument("InvalidGetPathOfFileAboveParameter", file);
FindAppConfigFile.cs (2)
39
ErrorUtilities
.VerifyThrowArgumentNull(_primaryList, nameof(PrimaryList));
53
ErrorUtilities
.VerifyThrowArgumentNull(_secondaryList, nameof(SecondaryList));
FindInList.cs (1)
30
ErrorUtilities
.VerifyThrowArgumentNull(_list, nameof(List));
GenerateResource.cs (5)
620
ErrorUtilities
.VerifyThrowInternalNull(resGenCommand);
2102
ErrorUtilities
.VerifyThrow(OutputResources != null && OutputResources.Length != 0, "Should be at least one output resource");
2186
ErrorUtilities
.VerifyThrow(_cache != null, "We did not create a cache!");
2718
ErrorUtilities
.VerifyThrow(_readers.Count == 1,
2728
ErrorUtilities
.VerifyThrow(_readers.Count == 1,
GetAssemblyIdentity.cs (1)
35
ErrorUtilities
.VerifyThrowArgumentNull(_assemblyFiles, nameof(AssemblyFiles));
GetInstalledSDKLocations.cs (2)
71
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(TargetPlatformVersion));
86
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(TargetPlatformIdentifier));
GetSDKReferenceFiles.cs (4)
97
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(CacheFileFolderPath));
111
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(ResolvedSDKReferences));
126
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(ReferenceExtensions));
664
ErrorUtilities
.VerifyThrowArgument(sdkIdentity.Length != 0, "GetSDKReferenceFiles.NoOriginalItemSpec", sdk.ItemSpec);
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);
MakeDir.cs (1)
24
ErrorUtilities
.VerifyThrowArgumentNull(_directories, nameof(Directories));
Modifiers.cs (8)
186
ErrorUtilities
.VerifyThrow(itemSpec != null, "Need item-spec to modify.");
187
ErrorUtilities
.VerifyThrow(modifier != null, "Need modifier to apply to item-spec.");
218
ErrorUtilities
.VerifyThrow(FileUtilitiesRegex.StartsWithUncPattern(modifiedItemSpec),
279
ErrorUtilities
.VerifyThrow((modifiedItemSpec.Length > length) && IsSlash(modifiedItemSpec[length]),
287
ErrorUtilities
.VerifyThrow(!string.IsNullOrEmpty(modifiedItemSpec) && IsSlash(modifiedItemSpec[0]),
389
ErrorUtilities
.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier);
398
ErrorUtilities
.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier);
403
ErrorUtilities
.ThrowInvalidOperation("Shared.InvalidFilespecForTransform", modifier, itemSpec, e.Message);
MSBuild.cs (4)
165
ErrorUtilities
.ThrowInternalError("Unexpected case {0}", _skipNonExistentProjects);
169
ErrorUtilities
.ThrowInternalErrorUnreachable();
349
ErrorUtilities
.VerifyThrow(skipNonExistProjects == SkipNonExistentProjectsBehavior.Error, "skipNonexistentProjects has unexpected value {0}", skipNonExistProjects);
685
ErrorUtilities
.VerifyThrowArgument(ConversionUtilities.CanConvertStringToBool(value), "MSBuild.InvalidSkipNonexistentProjectValue");
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);
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);
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.");
ReadOnlyCollection.cs (6)
38
ErrorUtilities
.VerifyThrow(backing != null, "Need backing collection");
101
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
109
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
132
ErrorUtilities
.VerifyThrowArgumentNull(array);
155
ErrorUtilities
.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
188
ErrorUtilities
.VerifyThrowArgumentNull(array);
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");
RedistList.cs (4)
294
ErrorUtilities
.VerifyThrowArgumentNull(frameworkDirectory);
432
ErrorUtilities
.VerifyThrowArgumentNull(assemblyName);
994
ErrorUtilities
.VerifyThrowArgumentNull(subsetToSearchFor);
1018
ErrorUtilities
.VerifyThrowArgumentNull(frameworkDirectory);
RemoveDir.cs (1)
31
ErrorUtilities
.VerifyThrowArgumentNull(_directories, nameof(Directories));
ResolveProjectBase.cs (1)
33
ErrorUtilities
.VerifyThrowArgumentNull(_projectReferences, nameof(ProjectReferences));
ResolveSDKReference.cs (5)
128
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(SDKReferences));
144
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(InstalledSDKs));
733
ErrorUtilities
.VerifyThrowArgumentNull(taskItem);
734
ErrorUtilities
.VerifyThrowArgumentLength(sdkName);
735
ErrorUtilities
.VerifyThrowArgumentLength(sdkVersion);
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);
SGen.cs (2)
117
ErrorUtilities
.ThrowInternalErrorUnreachable();
124
ErrorUtilities
.ThrowInternalErrorUnreachable();
StreamMappedString.cs (5)
195
ErrorUtilities
.VerifyThrow(originalPageNumber != _currentPageNumber, "Expected a new page.");
290
ErrorUtilities
.VerifyThrow(_charactersRead != _pageSize, "Attempt to append to non-last page.");
305
ErrorUtilities
.VerifyThrow(_priorPage != null, "There is no last character in the stream.");
389
ErrorUtilities
.VerifyThrow(charactersExtracted > 0, "Expected non-zero extraction count.");
404
ErrorUtilities
.VerifyThrow(page >= _currentPageNumber - 1 && page <= _currentPageNumber, "Could not get character count for this page.");
SystemState.cs (1)
171
ErrorUtilities
.VerifyThrowArgumentNull(translator);
TaskLoggingHelperExtension.cs (4)
93
ErrorUtilities
.VerifyThrowArgumentNull(resourceName);
94
ErrorUtilities
.VerifyThrowInvalidOperation(TaskResources != null, "Shared.TaskResourcesNotRegistered", TaskName);
95
ErrorUtilities
.VerifyThrowInvalidOperation(TaskSharedResources != null, "Shared.TaskResourcesNotRegistered", TaskName);
105
ErrorUtilities
.VerifyThrowArgument(resourceString != null, "Shared.TaskResourceNotFound", resourceName, TaskName);
TempFileUtilities.cs (2)
162
ErrorUtilities
.VerifyThrowArgumentLengthIfNotNull(directory, nameof(directory));
188
ErrorUtilities
.VerifyThrow(!FileSystems.Default.FileExists(file), "Guid should be unique");
tokenCharReader.cs (2)
268
ErrorUtilities
.VerifyThrow(originalPosition != _position, "Expected position to be incremented.");
275
ErrorUtilities
.VerifyThrow(originalPosition != _position, "Expected position to be incremented.");
Unzip.cs (1)
174
ErrorUtilities
.VerifyThrowInvalidOperation(fullDestinationPath.StartsWith(fullDestinationDirectoryPath, FileUtilities.PathComparison), "Unzip.ZipSlipExploit", fullDestinationPath);
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");
XslTransformation.cs (3)
76
ErrorUtilities
.VerifyThrowArgumentNull(_outputPaths, "OutputPath");
103
ErrorUtilities
.VerifyThrowArgumentNull(_outputPaths, "OutputPath");
492
ErrorUtilities
.ThrowInternalErrorUnreachable();
Microsoft.Build.Tasks.UnitTests (9)
ErrorUtilities_Tests.cs (7)
19
ErrorUtilities
.VerifyThrow(false, "msbuild rules");
34
ErrorUtilities
.VerifyThrow(true, "msbuild rules");
41
ErrorUtilities
.VerifyThrow(true, "blah");
48
ErrorUtilities
.VerifyThrow(true, "{0}", "a");
55
ErrorUtilities
.VerifyThrow(true, "{0}{1}", "a", "b");
62
ErrorUtilities
.VerifyThrow(true, "{0}{1}{2}", "a", "b", "c");
69
ErrorUtilities
.VerifyThrow(true, "{0}{1}{2}{3}", "a", "b", "c", "d");
QuotingUtilities.cs (2)
71
ErrorUtilities
.VerifyThrow(maxSplits >= 2, "There is no point calling this method for less than two splits.");
75
ErrorUtilities
.VerifyThrow(separators.IndexOf('"') == -1, "The double-quote character is not supported as a separator.");