171 references to ErrorUtilities
Microsoft.Build.Tasks.Core (162)
AppConfig\BindingRedirect.cs (4)
40
ErrorUtilities
.VerifyThrowArgument(!String.IsNullOrEmpty(oldVersion), "AppConfig.BindingRedirectMissingOldVersion");
61
ErrorUtilities
.ThrowArgument(e, "AppConfig.InvalidOldVersionAttribute", e.Message);
67
ErrorUtilities
.VerifyThrowArgument(!String.IsNullOrEmpty(newVersionAttribute), "AppConfig.BindingRedirectMissingNewVersion");
75
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)
74
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)
405
ErrorUtilities
.VerifyThrow(assemblyName.Name != null, "Got an empty assembly name.");
430
ErrorUtilities
.VerifyThrow(assemblyName.Name != null, "Got an empty assembly name.");
1654
ErrorUtilities
.VerifyThrow(dependencyIterations < maxIterations, "Maximum iterations exceeded while looking for dependencies.");
1673
ErrorUtilities
.VerifyThrow(moreResolvableIterations < maxIterations, "Maximum iterations exceeded while looking for resolvable references.");
2338
ErrorUtilities
.VerifyThrow(assemblyReference0.assemblyName.FullName != null, "Got a null assembly name fullname. (0)");
2339
ErrorUtilities
.VerifyThrow(assemblyReference1.assemblyName.FullName != null, "Got a null assembly name fullname. (1)");
2544
ErrorUtilities
.VerifyThrowInternalNull(a);
2545
ErrorUtilities
.VerifyThrowInternalNull(b);
AssemblyDependency\ResolveAssemblyReference.cs (8)
342
ErrorUtilities
.VerifyThrowArgumentNull(value, "TargetFrameworkSubsets");
474
ErrorUtilities
.VerifyThrowArgumentNull(value, "InstalledAssemblySubsetTables");
505
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullFrameworkAssemblyTables");
857
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullTargetFrameworkSubsetNames");
875
ErrorUtilities
.VerifyThrowArgumentNull(value, "profileName");
894
ErrorUtilities
.VerifyThrowArgumentNull(value, "FullFrameworkFolders");
1328
ErrorUtilities
.VerifyThrowInternalNull(conflictCandidate);
1749
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(
ConversionUtilities.cs (3)
7
using Error = Microsoft.Build.Shared.
ErrorUtilities
;
38
Error
.ThrowArgument("Shared.CannotConvertStringToBool", parameterValue);
147
Error
.ThrowInternalError("Cannot numeric evaluate");
ConvertToAbsolutePath.cs (1)
29
ErrorUtilities
.VerifyThrowArgumentNull(_paths, nameof(Paths));
Copy.cs (1)
627
ErrorUtilities
.ThrowInternalError("Failed posting a file copy to an ActionBlock. Should not happen with block at max int capacity.");
CreateManifestResourceName.cs (4)
53
ErrorUtilities
.VerifyThrowArgumentNull(_resourceFiles, nameof(ResourceFiles));
298
ErrorUtilities
.VerifyThrowArgumentNull(subName);
336
ErrorUtilities
.VerifyThrowArgumentNull(name);
368
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)
231
ErrorUtilities
.ThrowInternalError("Unexpected filesystem entity type.");
449
ErrorUtilities
.VerifyThrow(!HasWildcards(path),
519
ErrorUtilities
.VerifyThrow(entries.Count == 1,
844
ErrorUtilities
.VerifyThrow((recursionState.SearchData.Filespec == null) || (recursionState.SearchData.RegexFileMatch == null),
847
ErrorUtilities
.VerifyThrow((recursionState.SearchData.Filespec != null) || (recursionState.SearchData.RegexFileMatch != null),
850
ErrorUtilities
.VerifyThrow(recursionState.RemainingWildcardDirectory != null, "Expected non-null remaning wildcard directory.");
1186
ErrorUtilities
.VerifyThrow(
1678
ErrorUtilities
.ThrowInternalError("Unexpected empty 'input' provided.");
FileState.cs (2)
130
ErrorUtilities
.ThrowInternalErrorUnreachable();
250
ErrorUtilities
.VerifyThrowArgumentLength(filename);
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);
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);
2107
ErrorUtilities
.VerifyThrow(OutputResources != null && OutputResources.Length != 0, "Should be at least one output resource");
2191
ErrorUtilities
.VerifyThrow(_cache != null, "We did not create a cache!");
2725
ErrorUtilities
.VerifyThrow(_readers.Count == 1,
2735
ErrorUtilities
.VerifyThrow(_readers.Count == 1,
GetAssemblyIdentity.cs (1)
33
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)
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);
MSBuild.cs (4)
165
ErrorUtilities
.ThrowInternalError("Unexpected case {0}", _skipNonExistentProjects);
169
ErrorUtilities
.ThrowInternalErrorUnreachable();
352
ErrorUtilities
.VerifyThrow(skipNonExistProjects == SkipNonExistentProjectsBehavior.Error, "skipNonexistentProjects has unexpected value {0}", skipNonExistProjects);
688
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);
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.");
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)
124
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(SDKReferences));
140
ErrorUtilities
.VerifyThrowArgumentNull(value, nameof(InstalledSDKs));
729
ErrorUtilities
.VerifyThrowArgumentNull(taskItem);
730
ErrorUtilities
.VerifyThrowArgumentLength(sdkName);
731
ErrorUtilities
.VerifyThrowArgumentLength(sdkVersion);
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);
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)
73
ErrorUtilities
.VerifyThrowArgumentNull(_outputPaths, "OutputPath");
100
ErrorUtilities
.VerifyThrowArgumentNull(_outputPaths, "OutputPath");
491
ErrorUtilities
.ThrowInternalErrorUnreachable();
Microsoft.Build.Tasks.UnitTests (9)
ErrorUtilities_Tests.cs (7)
21
ErrorUtilities
.VerifyThrow(false, "msbuild rules");
36
ErrorUtilities
.VerifyThrow(true, "msbuild rules");
43
ErrorUtilities
.VerifyThrow(true, "blah");
50
ErrorUtilities
.VerifyThrow(true, "{0}", "a");
57
ErrorUtilities
.VerifyThrow(true, "{0}{1}", "a", "b");
64
ErrorUtilities
.VerifyThrow(true, "{0}{1}{2}", "a", "b", "c");
71
ErrorUtilities
.VerifyThrow(true, "{0}{1}{2}{3}", "a", "b", "c", "d");
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.");