Choose\GroupingCollection.cs (16)
13using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
66ErrorUtilities.VerifyThrow(this.propertyGroupCount >= 0, "The property group count should never be negative");
138error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
154ErrorUtilities.VerifyThrow(this.itemGroupCount >= 0, "The item group count should never be negative");
208error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
289error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
307error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
361error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
366error.VerifyThrow(this.propertyGroupCount >= 0, "Too many calls to RemovePropertyGroup().");
416error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
422error.VerifyThrow(this.itemGroupCount >= 0, "Too many calls to RemoveItemGroup().");
440error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
473error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
505error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
509error.VerifyThrow(this.chooseCount >= 0, "Too many calls to RemoveChoose().");
523error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!");
Engine\BuildTask.cs (20)
15using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
72error.VerifyThrow(taskElement != null, "Need a valid XML node.");
75error.VerifyThrow(parentTarget != null, "Need a valid target parent.");
158error.VerifyThrowInvalidOperation(this.taskElement != null,
162error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
202error.VerifyThrowInvalidOperation(this.taskElement != null,
206error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
235ErrorUtilities.VerifyThrow(this.ParentTarget != null, "ParentTarget should not be null");
255ErrorUtilities.VerifyThrowInvalidOperation(taskEngine.FindTask(),
348error.VerifyThrowArgument(!XMakeAttributes.IsSpecialTaskAttribute(attributeName),
351error.VerifyThrowInvalidOperation(this.taskElement != null,
394error.VerifyThrowArgument(!XMakeAttributes.IsSpecialTaskAttribute(parameterName),
398error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
401error.VerifyThrowInvalidOperation(this.taskElement != null,
431error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
434error.VerifyThrowInvalidOperation(this.taskElement != null,
460error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
463error.VerifyThrowInvalidOperation(this.taskElement != null,
483error.VerifyThrowInvalidOperation(this.taskElement != null,
486error.VerifyThrowInvalidOperation(this.parentTarget != null,
Engine\Engine.cs (44)
21using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
325ErrorUtilities.VerifyThrow(startupDirectory != null, "Need startup directory");
488error.VerifyThrowArgumentNull(value, "BinPath");
886error.VerifyThrow(toolsetVersion != null, "Expect non-null toolset version");
887error.VerifyThrow(toolsetStateMap.ContainsKey(toolsetVersion), "Expected to see the toolset in the table");
901error.VerifyThrowArgumentNull(toolset, nameof(toolset));
1010ErrorUtilities.VerifyThrow(this.defaultToolsVersion != null,
1019ErrorUtilities.VerifyThrowInvalidOperation(this.ProjectsLoadedByHost.Count == 0,
1022ErrorUtilities.VerifyThrowArgumentNull(value, "value");
1038error.VerifyThrowArgumentNull(logger, nameof(logger));
1107error.VerifyThrowArgumentNull(forwardingLogger, nameof(forwardingLogger));
1347ErrorUtilities.VerifyThrowArgumentNull(projectFullFileName, nameof(projectFullFileName));
1368error.VerifyThrowArgumentNull(project, nameof(project));
1370ErrorUtilities.VerifyThrow(project.IsLoadedByHost, "How did the caller get a reference to this Project object if it's not marked as loaded?");
1372ErrorUtilities.VerifyThrowInvalidOperation(project.ParentEngine == this, "IncorrectObjectAssociation", "Project", "Engine");
1415ErrorUtilities.VerifyThrow(project.IsLoadedByHost, "This method can only be called for projects loaded by the host.");
1428error.VerifyThrow((Project)projectsLoadedByHost[oldFullFileName] == project, "The engine's loaded project table was not up-to-date.");
1499ErrorUtilities.VerifyThrow(this.projectsLoadedByHost.Count == 0, "All projects did not get unloaded?");
1607ErrorUtilities.VerifyThrow(this.numberOfProjectsInProgress == 0 || terminatingBuildRequest != null,
1689ErrorUtilities.VerifyThrow(engineCommand != null, "Should have gotten a command");
1704ErrorUtilities.VerifyThrow(currentRequest != null, "Should have gotten an evalution request");
1734ErrorUtilities.VerifyThrow(taskExecutionContext != null, "Should have gotten a task update");
1784ErrorUtilities.VerifyThrow(false, "The event type should be 0, 1, 2 or 3");
1872error.VerifyThrowArgument(project != null, "MissingProject", "Project");
1875error.VerifyThrowInvalidOperation(project.ParentEngine == this, "IncorrectObjectAssociation", "Project", "Engine");
2033ErrorUtilities.VerifyThrow(this.numberOfProjectsInProgress != 0, "Number of Projects in progress should not be 0 before the count is decremented");
2070ErrorUtilities.VerifyThrow(this.cacheOfBuildingProjects.GetProject(loadedProject.FullFileName, loadedProject.GlobalProperties, loadedProject.ToolsVersion) == null,
2210error.VerifyThrowArgumentNull(projectFile, "projectFileName");
2211error.VerifyThrowArgument(projectFile.Length > 0, "EmptyProjectFileName");
2272error.VerifyThrowArgumentArraysSameLength(projectFiles, targetNamesPerProject, "projectFiles", "targetNamesPerProject");
2273error.VerifyThrowArgument(projectFiles.Length > 0, "projectFilesEmpty");
2274error.VerifyThrowArgumentArraysSameLength(projectFiles, globalPropertiesPerProject, "projectFiles", "globalPropertiesPerProject");
2275error.VerifyThrowArgumentArraysSameLength(projectFiles, targetOutputsPerProject, "projectFiles", "targetOutputsPerProject");
2276error.VerifyThrowArgumentArraysSameLength(projectFiles, toolsVersions, "projectFiles", "toolsVersions");
2281error.VerifyThrowArgumentNull(projectFiles[i], "projectFiles[" + i + "]");
2282error.VerifyThrowArgument(projectFiles[i].Length > 0, "projectFilesEmptyElement", i);
2480error.VerifyThrowArgumentNull(projectFile, "projectFileName");
2481error.VerifyThrowArgument(projectFile.Length > 0, "EmptyProjectFileName");
2483error.VerifyThrow(buildRequest.GlobalProperties != null, "Global Properties should not be null");
2489ErrorUtilities.VerifyThrowArgument(projectFileInfo.Exists, "ProjectFileNotFound", projectFile);
2603ErrorUtilities.VerifyThrow(cacheOfBuildingProjects.GetRemoteProject(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse) == EngineCallback.invalidNode,
2878error.VerifyThrowArgument(childProjectFile.Length > 0, "EmptyProjectFileName");
2881ErrorUtilities.VerifyThrowArgument(File.Exists(childProjectFile), "ProjectFileNotFound", childProjectFile);
3009ErrorUtilities.VerifyThrow(executionState != null,
Engine\EngineLoggingServices.cs (22)
67ErrorUtilities.VerifyThrow(false, "This method should be defined in a subclass");
80ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
111ErrorUtilities.VerifyThrowArgumentNull(eventArray, nameof(eventArray));
144ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
168ErrorUtilities.VerifyThrowArgumentNull(eventArray, nameof(eventArray));
245ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
265ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
284ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
302ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
336ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for comment message.");
349ErrorUtilities.VerifyThrow(message != null,
396ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for error message.");
416ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file.");
417ErrorUtilities.VerifyThrow(message != null, "Need error message.");
451ErrorUtilities.VerifyThrow(invalidProjectFileException != null, "Need exception context.");
499ErrorUtilities.VerifyThrow(taskName != null, "Must specify the name of the task that failed.");
515ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for error message.");
551ErrorUtilities.VerifyThrow(taskName != null, "Must specify the name of the task that failed.");
552ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file.");
591ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for warning message.");
611ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file.");
612ErrorUtilities.VerifyThrow(message != null, "Need warning message.");
Engine\EngineProxy.cs (19)
126ErrorUtilities.VerifyThrow(parentModule != null, "No parent module.");
127ErrorUtilities.VerifyThrow(loggingServices != null, "No logging services.");
128ErrorUtilities.VerifyThrow(projectFileOfTaskNode != null, "Need project file path string");
146ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
147ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
215ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
216ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
292ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
293ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
309ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e));
310ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
330ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
354ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
370ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
384ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
442ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
530ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask");
532ErrorUtilities.VerifyThrowArgumentNull(projectFileNames, nameof(projectFileNames));
533ErrorUtilities.VerifyThrowArgumentNull(globalProperties, "globalPropertiesPerProject");
Engine\Expander.cs (10)
112ErrorUtilities.VerifyThrow(options != ExpanderOptions.Invalid, "Must specify options");
147ErrorUtilities.VerifyThrow((options & ExpanderOptions.ExpandMetadata) != 0, "Must be expanding metadata");
148ErrorUtilities.VerifyThrow(implicitMetadataItemType == null || String.Equals(implicitMetadataItemType, itemType, StringComparison.OrdinalIgnoreCase), "Unexpected metadata type");
309ErrorUtilities.VerifyThrow(expression != null, "Must pass in non-null expression.");
1359ErrorUtilities.VerifyThrow(functionType.Item1 != null || functionType.Item2 != null, "Function type information needs either string or type represented.");
1433ErrorUtilities.VerifyThrow(assemblyNameEnd > 0, "Invalid typename: {0}", typeName);
1516ErrorUtilities.VerifyThrow(argumentsEndIndex != -1, "Unmatched braces when constructing function.", "$(" + expressionFunction + ")");
1669ErrorUtilities.VerifyThrowArgumentNull(argumentBuilder, nameof(argumentBuilder));
1932ErrorUtilities.VerifyThrow(itemMetadataMatch.Success, "Need a valid item metadata.");
2088ErrorUtilities.VerifyThrow(lookup != null, "Need items");
Engine\ImportCollection.cs (13)
38ErrorUtilities.VerifyThrow(parentProject != null,
57ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!");
73ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!");
85ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!");
98ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!");
111ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!");
134ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!");
148ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!");
165ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!");
176ErrorUtilities.VerifyThrowArgumentLength(projectFile, nameof(projectFile));
203ErrorUtilities.VerifyThrowArgumentNull(importToRemove, nameof(importToRemove));
206ErrorUtilities.VerifyThrowInvalidOperation(!importToRemove.IsImported,
210ErrorUtilities.VerifyThrowInvalidOperation(importToRemove.ParentProject == this.parentProject,
Engine\Project.cs (52)
21using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
559ErrorUtilities.VerifyThrowArgumentNull(value, "value");
617ErrorUtilities.VerifyThrowArgumentNull(value, "value");
659ErrorUtilities.VerifyThrowInvalidOperation(parentEngine != null, "ProjectInvalidUnloaded");
758ErrorUtilities.VerifyThrow(false, "How did this.buildEnabled get a bogus value?");
797error.VerifyThrowArgumentLength(value, "value");
800error.VerifyThrowInvalidOperation(this.ParentEngine.ToolsetStateMap.ContainsKey(value), "UnrecognizedToolsVersion", value);
931ErrorUtilities.VerifyThrowArgumentNull(value, "value");
972error.VerifyThrowArgumentNull(value, "value");
1145error.VerifyThrow(this.rawPropertyGroups != null,
1159error.VerifyThrow(this.targets != null,
1173ErrorUtilities.VerifyThrow(this.usingTasks != null, "Project object not initialized. usingTasks is null.");
1186ErrorUtilities.VerifyThrow(this.imports != null, "Project object not initialized. imports is null.");
1201error.VerifyThrow(this.rawItemGroups != null,
1761ErrorUtilities.VerifyThrowArgumentNull(projectFileName, nameof(projectFileName));
1762ErrorUtilities.VerifyThrowArgument(projectFileName.Length > 0, "EmptyProjectFileName");
1763ErrorUtilities.VerifyThrowArgument(File.Exists(projectFileName), "ProjectFileNotFound", projectFileName);
1897ErrorUtilities.VerifyThrowArgumentNull(textReader, nameof(textReader));
1949ErrorUtilities.VerifyThrowArgumentNull(projectXml, nameof(projectXml));
1991ErrorUtilities.VerifyThrowArgumentNull(projectXml, nameof(projectXml));
2014ErrorUtilities.VerifyThrow(projectXml != null, "Need project XML.");
2406error.VerifyThrowArgumentLength(propertyName, nameof(propertyName));
2409error.VerifyThrowArgument(propertyValue != null,
2584error.VerifyThrowArgumentNull(propertyGroupToRemove, nameof(propertyGroupToRemove));
2587error.VerifyThrowInvalidOperation(!propertyGroupToRemove.IsImported,
2591error.VerifyThrowInvalidOperation(
2599ErrorUtilities.VerifyThrow(parentElement != null, "Why doesn't this PG have a parent XML element?");
2602ErrorUtilities.VerifyThrow(propertyGroupToRemove.ParentCollection != null, "Why doesn't this PG have a parent collection?");
2619error.VerifyThrowArgumentNull(propertyGroupToRemove, nameof(propertyGroupToRemove));
2622error.VerifyThrowInvalidOperation(
2629ErrorUtilities.VerifyThrow(propertyGroupToRemove.ParentCollection != null, "Why doesn't this PG have a parent collection?");
2733ErrorUtilities.VerifyThrowArgumentLength(itemName, nameof(itemName));
2734ErrorUtilities.VerifyThrowArgumentLength(itemInclude, nameof(itemInclude));
2872error.VerifyThrowArgumentNull(itemGroupToRemove, nameof(itemGroupToRemove));
2875error.VerifyThrowInvalidOperation(!itemGroupToRemove.IsImported,
2879error.VerifyThrowInvalidOperation(
2887ErrorUtilities.VerifyThrow(parentElement != null, "Why doesn't this IG have a parent XML element?");
2891ErrorUtilities.VerifyThrow(itemGroupToRemove.ParentCollection != null, "Why doesn't this IG have a parent collection?");
2921error.VerifyThrowArgumentNull(itemToRemove, nameof(itemToRemove));
2924error.VerifyThrowInvalidOperation(!itemToRemove.IsImported, "CannotModifyImportedProjects");
2935error.VerifyThrowInvalidOperation(parentItemGroup != null, "ObjectIsNotInProject");
2946error.VerifyThrow(itemToRemove.ParentPersistedItem != null, "No parent BuildItem for item to be removed.");
2949error.VerifyThrow(itemToRemove.ParentPersistedItemGroup != null,
3240ErrorUtilities.VerifyThrow(taskExecutionContext != null, "Task context should be non-null");
3251ErrorUtilities.VerifyThrow(
3255ErrorUtilities.VerifyThrow(
3672error.VerifyThrow(mainProjectElement != null,
3745error.VerifyThrow(projectElement != null,
3832error.VerifyThrow(projectElement != null,
4312ErrorUtilities.VerifyThrow(false, "Unexpected return type from this.rawGroups.PropertyGroupsAndChooses");
4330error.VerifyThrow(ignoreCondition || honorCondition, "Both ignoreCondition and honorCondition can't be false.");
4344ErrorUtilities.VerifyThrow(false, "Unexpected return type from this.rawGroups.ItemGroupsAndChooses");
Engine\Target.cs (15)
17using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
135error.VerifyThrow(targetElement != null, "Need a valid XML node.");
517error.VerifyThrow(this.taskElementList != null, "List of TaskElements not initialized!");
603error.VerifyThrow(
607error.VerifyThrow(targetOutputItems != null,
677error.VerifyThrow(false, "Build state {0} not handled in Target.Build method", buildState);
752error.VerifyThrowInvalidOperation(this.targetElement != null, "CannotSetCondition");
755error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, "CannotModifyImportedProjects");
775error.VerifyThrow(this.taskElementList != null, "Arraylist not initialized!");
776error.VerifyThrowArgumentLength(taskName, nameof(taskName));
779error.VerifyThrowInvalidOperation(!this.IsImported, "CannotModifyImportedProjects");
806error.VerifyThrowInvalidOperation(!this.IsImported, "CannotModifyImportedProjects");
808error.VerifyThrow(this.taskElementList != null, "Arraylist not initialized!");
809error.VerifyThrowArgumentNull(taskElement, nameof(taskElement));
812error.VerifyThrowInvalidOperation(taskElement.ParentTarget == this,
Engine\TargetCollection.cs (13)
14using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
46error.VerifyThrow(parentProject != null, "Must pass in valid parent project object.");
77error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
119error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
140error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
155error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
169error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
186error.VerifyThrow(this.parentProject != null, "Need parent project.");
218error.VerifyThrowArgumentNull(targetToRemove, nameof(targetToRemove));
221error.VerifyThrowInvalidOperation(!targetToRemove.IsImported,
225error.VerifyThrowInvalidOperation(targetToRemove.ParentProject == this.parentProject,
259error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
272error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!");
Engine\TargetDependencyAnalyzer.cs (11)
49ErrorUtilities.VerifyThrow(projectDirectory != null, "Need a project directory.");
50ErrorUtilities.VerifyThrow(targetToAnalyze != null, "Need a target to analyze.");
51ErrorUtilities.VerifyThrow(targetToAnalyze.TargetElement != null, "Need a target element.");
220ErrorUtilities.VerifyThrow(itemVectorsReferencedInBothTargetInputsAndOutputs.Count > 0, "The target must have inputs.");
590ErrorUtilities.VerifyThrow(inputItemVectors.Count == 1,
609ErrorUtilities.VerifyThrow(inputItems.Count == outputItems.Count,
664ErrorUtilities.VerifyThrow(numberOfInputItemVectorsWithAllChangedItems <= itemVectorsReferencedInBothTargetInputsAndOutputs.Count,
670ErrorUtilities.VerifyThrow(result == DependencyAnalysisResult.IncrementalBuild,
807ErrorUtilities.VerifyThrow((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorCollectionPartition.Count == 1),
916ErrorUtilities.VerifyThrow((inputs.Count > 0) && (outputs.Count > 0), "Need to specify inputs and outputs.");
1142ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(path1) && !string.IsNullOrEmpty(path2),
Engine\TargetExecutionWrapper.cs (17)
136ErrorUtilities.VerifyThrow(inProgressBuildState != InProgressBuildState.NotInProgress, "Not in progress");
219ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.BuildingDependencies, "Wrong state");
221ErrorUtilities.VerifyThrow(currentDependentTarget < dependsOnTargetNames.Count, "No dependent targets left");
226ErrorUtilities.VerifyThrow(
290ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.BuildingErrorClause, "Wrong state");
292ErrorUtilities.VerifyThrow(currentErrorTarget < onErrorTargets.Count, "No error targets left");
297ErrorUtilities.VerifyThrow(
512ErrorUtilities.VerifyThrow(targetElement != null,
537ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.RunningTasks, "Wrong state");
539ErrorUtilities.VerifyThrow(currentBucket < buckets.Count, "No buckets left");
692ErrorUtilities.VerifyThrow(taskElementList.Count > (currentTask - skippedNodeCount),
845ErrorUtilities.VerifyThrow(howToBuild == DependencyAnalysisResult.FullBuild ||
919ErrorUtilities.VerifyThrow(
923ErrorUtilities.VerifyThrow(targetOutputItems != null,
1022ErrorUtilities.VerifyThrow(
1029ErrorUtilities.VerifyThrow(
1045ErrorUtilities.VerifyThrow(
Engine\TaskEngine.cs (21)
71ErrorUtilities.VerifyThrow(taskNodeXmlElement != null, "Need to specify the task node.");
72ErrorUtilities.VerifyThrow(projectFileOfTaskNode != null, "Need to specify path of project.");
73ErrorUtilities.VerifyThrow(parentProjectFullFileName != null, "Need to specify name of project.");
74ErrorUtilities.VerifyThrow(loggingServices != null, "Need to specify the node logger.");
265ErrorUtilities.VerifyThrow(lookup != null, "Need to specify items available to task.");
432ErrorUtilities.VerifyThrow(GatherTaskOutputs(howToExecuteTask, null, bucket),
809ErrorUtilities.VerifyThrow(taskOutputSpecification.TaskParameterAttribute != null,
811ErrorUtilities.VerifyThrow(taskOutputSpecification.TaskParameterAttribute.Value.Length > 0,
826ErrorUtilities.VerifyThrow(taskOutputSpecification.ItemNameAttribute != null,
829ErrorUtilities.VerifyThrow(taskOutputSpecification.ItemNameAttribute.Value.Length > 0,
840ErrorUtilities.VerifyThrow(taskOutputSpecification.IsProperty,
843ErrorUtilities.VerifyThrow(taskOutputSpecification.PropertyNameAttribute != null,
846ErrorUtilities.VerifyThrow(taskOutputSpecification.PropertyNameAttribute.Value.Length > 0,
900ErrorUtilities.VerifyThrow(task != null, "Need instantiated task to retrieve outputs from.");
996ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type.");
1017ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name.");
1054ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type.");
1068ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name.");
1130ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type.");
1164ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name.");
1446ErrorUtilities.VerifyThrow(parameterValue != null,
Items\BuildItem.cs (45)
419ErrorUtilities.VerifyThrowArgumentNull(itemInclude, nameof(itemInclude));
425ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[itemName] == null, "CannotModifyReservedItem", itemName);
437ErrorUtilities.VerifyThrowArgumentLength(itemName, "itemType");
505ErrorUtilities.VerifyThrowArgumentNull(taskItem, nameof(taskItem));
562ErrorUtilities.VerifyThrow(name != null, "Get Name: Item has not been initialized.");
568ErrorUtilities.VerifyThrow(name != null, "Set Name: Item has not been initialized.");
569ErrorUtilities.VerifyThrowArgumentLength(value, "Name");
572ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[value] == null, "CannotModifyReservedItem", value);
633ErrorUtilities.ThrowInternalError("Item has not been initialized.");
640ErrorUtilities.VerifyThrowArgument(value != null, "NullIncludeNotAllowed", XMakeAttributes.include);
667ErrorUtilities.VerifyThrow(false, "Item has not been initialized.");
755ErrorUtilities.VerifyThrowInvalidOperation(IsBackedByXml, "CannotSetExcludeOnVirtualItem", XMakeAttributes.exclude);
758ErrorUtilities.VerifyThrowInvalidOperation(this.ParentPersistedItem == null, "CannotSetExcludeOnEvaluatedItem", XMakeAttributes.exclude);
788ErrorUtilities.VerifyThrowInvalidOperation(IsBackedByXml, "CannotSetCondition");
858ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedItemGroup != null)) || ((value != null) && (this.parentPersistedItemGroup == null)),
882ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedItem != null)) || ((value != null) && (this.parentPersistedItem == null)),
1148ErrorUtilities.VerifyThrow(expander != null, "Null expander passed in.");
1156ErrorUtilities.VerifyThrow((this.evaluatedCustomMetadata != null) && (this.unevaluatedCustomMetadata != null),
1205ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName));
1206ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomAttributes is null.");
1214ErrorUtilities.VerifyThrow(!unevaluatedCustomMetadata.ContainsKey(metadataName) || !FileUtilities.IsDerivableItemSpecModifier(metadataName),
1260ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null.");
1310ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly. evaluatedCustomMetadata is null.");
1329ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null.");
1358ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null.");
1376ErrorUtilities.VerifyThrowArgumentNull(destinationItem, nameof(destinationItem));
1389ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly.");
1454ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly. evaluatedCustomMetadata is null.");
1468ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null.");
1515ErrorUtilities.VerifyThrowArgument(!FileUtilities.IsDerivableItemSpecModifier(metadataName),
1518ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName));
1519ErrorUtilities.VerifyThrowArgumentNull(metadataValue, nameof(metadataValue));
1524ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[metadataName] == null,
1527ErrorUtilities.VerifyThrow((this.unevaluatedCustomMetadata != null) && (this.evaluatedCustomMetadata != null),
1610ErrorUtilities.VerifyThrowArgument(!FileUtilities.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName);
1612ErrorUtilities.VerifyThrow((this.unevaluatedCustomMetadata != null) && (this.evaluatedCustomMetadata != null), "Item not initialized properly.");
1661ErrorUtilities.VerifyThrow(itemSpecModifiers != null,
1682ErrorUtilities.VerifyThrow(parentProject != null, "This method should only get called on persisted items.");
1747ErrorUtilities.VerifyThrow(parentItemGroup != null, "Inconsistency -- is this item persisted or not?");
1756ErrorUtilities.VerifyThrowNoAssert(parentItemGroup.ParentProject != null, "Persisted BuildItemGroup doesn't have parent project.");
1789ErrorUtilities.VerifyThrowInvalidOperation(!importedFromAnotherProject, "CannotModifyImportedProjects");
1798ErrorUtilities.VerifyThrow(library != null, "Item definition library required when item is owned by project");
1820ErrorUtilities.VerifyThrow(ParentPersistedItemGroup != null, "No parent BuildItemGroup for item to be removed.");
1826ErrorUtilities.VerifyThrow(childItem.IsBackedByXml, "Must be backed by XML");
1953ErrorUtilities.VerifyThrow(unevaluatedCustomMetadata != null && evaluatedCustomMetadata != null, "Item is not initialized properly.");
Items\BuildItemGroup.cs (21)
228ErrorUtilities.VerifyThrow(itemsToImport != null, "Null BuildItemGroup passed in.");
229ErrorUtilities.VerifyThrow(itemsToImport != this, "Can't import into self.");
246ErrorUtilities.VerifyThrow(itemsToRemove != null, "Null BuildItemGroup passed in.");
247ErrorUtilities.VerifyThrow(itemsToRemove != this, "Can't remove self.");
257ErrorUtilities.VerifyThrow(itemsToRemove != null, "Null BuildItemGroup passed in.");
258ErrorUtilities.VerifyThrow(itemsToRemove != this, "Can't remove self.");
343ErrorUtilities.VerifyThrow(items != null, "BuildItemGroup has not been initialized.");
344ErrorUtilities.VerifyThrow(index <= items.Count, "Index out of range");
382ErrorUtilities.VerifyThrow(itemToAdd.IsBackedByXml, "Item does not have an XML element");
383ErrorUtilities.VerifyThrow(itemToAdd.ItemElement.OwnerDocument == xml.OwnerDocument, "Cannot add an Item with a different XML owner document.");
556ErrorUtilities.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed");
698ErrorUtilities.VerifyThrowInvalidOperation(!IsPersisted, errorResourceName);
723ErrorUtilities.VerifyThrowInvalidOperation(IsPersisted, errorResourceName);
731ErrorUtilities.VerifyThrowInvalidOperation(!importedFromAnotherProject, "CannotModifyImportedProjects");
739ErrorUtilities.VerifyThrow(this.items != null, "BuildItemGroup has not been initialized.");
747ErrorUtilities.VerifyThrowInvalidOperation(item?.ItemElement?.ParentNode == xml.Element, "ItemDoesNotBelongToItemGroup");
756ErrorUtilities.VerifyThrow(item.ParentPersistedItemGroup == this, "This item doesn't belong to this itemgroup");
772ErrorUtilities.VerifyThrow(pass == ProcessingPass.Pass2, "Pass should be Pass2 for ItemGroups.");
773ErrorUtilities.VerifyThrow(collectItemsIgnoringCondition || collectItemsRespectingCondition, "collectItemsIgnoringCondition and collectItemsRespectingCondition can't both be false.");
849ErrorUtilities.VerifyThrow(originalItem != null, "Can't add a null item to project.");
850ErrorUtilities.VerifyThrow(expander != null, "expander can't be null.");
ItemsAndProperties\Lookup.cs (11)
120ErrorUtilities.VerifyThrow(itemDefinitionLibrary != null, "Expect library");
300ErrorUtilities.VerifyThrowNoAssert(lookupEntries.Count >= 2, "Too many calls to Leave().");
626ErrorUtilities.VerifyThrow(existing == null, "Cannot add an itemgroup of this type.");
652ErrorUtilities.VerifyThrow(property.Type == PropertyType.OutputProperty, "Expected output property");
687ErrorUtilities.VerifyThrow(!item.IsPartOfProjectManifest, "Cannot dynamically add manifest items");
703ErrorUtilities.VerifyThrow(!item.IsPartOfProjectManifest, "Cannot dynamically add manifest items");
837ErrorUtilities.VerifyThrow(!cloneTable.ContainsKey(clone), "Should be new, not already in table!");
1020ErrorUtilities.VerifyThrowNoAssert(!tableOfItemsOfSameType.ContainsKey(item), "Item should not be in table");
1038ErrorUtilities.VerifyThrowNoAssert(!existing.Items.Contains(item), "Item should not be in table");
1071ErrorUtilities.VerifyThrowNoAssert(threadIdThatEnteredCurrentScope == Thread.CurrentThread.ManagedThreadId, "Only the thread that entered a scope may modify or leave it");
1080ErrorUtilities.VerifyThrowNoAssert(lookupEntries.Count > 1, "Operation in outer scope not supported");
LocalProvider\LocalNodeProvider.cs (12)
125ErrorUtilities.VerifyThrowArgumentNull(parameterName, nameof(parameterName));
183ErrorUtilities.VerifyThrow(nodeIds.Length == nodeData.Length, "Expected an ID for each node");
193ErrorUtilities.VerifyThrow(nodeLoggers != null, "Must call Initialize first");
194ErrorUtilities.VerifyThrow(loggerDescription != null, "Logger description should be non-null");
204ErrorUtilities.VerifyThrow(nodeLoggers != null, "Must call Initialize first");
205ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries");
230ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries");
275ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries");
276ErrorUtilities.VerifyThrow(nodeData[nodeIndex].NodeState == NodeState.Launched, "Node must be launched before result can be posted");
522ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count");
558ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count");
763ErrorUtilities.VerifyThrow(File.Exists(msbuildLocation), "Msbuild.exe cannot be found at: " + msbuildLocation);
Logging\ParallelLogger\ParallelConsoleLogger.cs (15)
484ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
485ErrorUtilities.VerifyThrowArgumentNull(e.ParentProjectBuildEventContext, "ParentProjectBuildEventContext");
539ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
544ErrorUtilities.VerifyThrow(startedEvent != null, "Started event should not be null in the finished event handler");
710ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
731ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
745ErrorUtilities.VerifyThrow(startedEvent != null, "Started event should not be null in the finished event handler");
778ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
819ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
853ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
899ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
952ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
980ErrorUtilities.VerifyThrow(false, "Impossible");
1266ErrorUtilities.VerifyThrow(startedEvent != null, "Project Started should not be null in deferred target started");
1374ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
Properties\BuildProperty.cs (18)
217ErrorUtilities.VerifyThrow(propertyElement != null,
265ErrorUtilities.VerifyThrowArgumentLength(propertyName, nameof(propertyName));
266ErrorUtilities.VerifyThrowArgumentNull(propertyValue, nameof(propertyValue));
296ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[this.Name] == null,
376ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(this.propertyName) && (this.propertyValue != null),
395ErrorUtilities.VerifyThrow(this.propertyValue != null,
403ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.ImportedProperty,
406ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.EnvironmentProperty,
409ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.ReservedProperty,
412ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.GlobalProperty,
427ErrorUtilities.VerifyThrowArgumentNull(value, "Value");
533ErrorUtilities.VerifyThrowInvalidOperation(this.propertyElement != null,
537ErrorUtilities.VerifyThrowInvalidOperation(this.Type != PropertyType.ImportedProperty,
586ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedPropertyGroup != null)) || ((value != null) && (this.parentPersistedPropertyGroup == null)),
608ErrorUtilities.VerifyThrow(expander != null, "Expander required to evaluated property.");
623ErrorUtilities.VerifyThrow(this.ParentPersistedPropertyGroup.ParentProject != null, "Persisted BuildPropertyGroup doesn't have parent project.");
673ErrorUtilities.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed");
683ErrorUtilities.VerifyThrow(Object.ReferenceEquals(clone.Value, this.Value), "Clone value should be identical reference");
Properties\BuildPropertyGroup.cs (36)
16using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities;
208error.VerifyThrow(propertyGroupElement != null, "Need valid <PropertyGroup> element.");
298error.VerifyThrow(ownerDocument != null, "Need valid XmlDocument owner for this property group.");
352error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
469error.VerifyThrow(this.propertyTableByName == null, "Did not expect a property hash table.");
481error.VerifyThrow(false, "Expected either a hash table or an array list of properties.");
512ErrorUtilities.VerifyThrow(false, "BuildPropertyGroup is imported, doesn't have an ownerDocument, and importedFilename is null.");
518ErrorUtilities.VerifyThrow(this.importedFromAnotherProject, "You can't set the imported filename on a non-imported PropertyGroup.");
554error.VerifyThrowArgument(value != null, "CannotSetPropertyToNull");
558error.VerifyThrowArgument(String.Equals(propertyName, value.Name, StringComparison.OrdinalIgnoreCase),
583error.VerifyThrow(this.propertyTableByName == null, "Did not expect a property hash table.");
598error.VerifyThrow(false, "Expected either a hash table or an array list of properties.");
687error.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed");
825ErrorUtilities.VerifyThrowInvalidOperation(parentProject?.IsBuilding != true, "CannotSetPropertyDuringBuild");
839error.VerifyThrow(existingProperty != null, "If we've overridden this property before, it must exist in the main property table.");
840error.VerifyThrow(existingProperty.Type == PropertyType.OutputProperty, "If we've overriden this property before, it must be stored as an output property in the main property table.");
844error.VerifyThrow((existingProperty == null) || (existingProperty.Type != PropertyType.OutputProperty),
918error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
1011error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
1016error.VerifyThrow(propertyToAdd.PropertyElement != null, "BuildProperty does not have an XML element");
1017error.VerifyThrow(propertyToAdd.PropertyElement.OwnerDocument == this.ownerDocument,
1038error.VerifyThrowArgumentNull(property, nameof(property));
1048error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject,
1202error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject || clearImportedPropertyGroup,
1383ErrorUtilities.VerifyThrow(compareToPropertyGroup != null, "Received a null propertyBag!");
1407ErrorUtilities.VerifyThrow(leftProperty != null, "How can we have a null entry in the hash table?");
1450error.VerifyThrowInvalidOperation(IsVirtual, errorResourceName, XMakeElements.propertyGroup);
1455error.VerifyThrow(this.propertyList == null,
1458error.VerifyThrow(this.propertyTableByName != null,
1483error.VerifyThrowInvalidOperation(IsPersisted, errorResourceName, arg);
1487error.VerifyThrow(this.propertyList != null,
1489error.VerifyThrow(this.propertyTableByName == null,
1491error.VerifyThrow(this.ownerDocument != null,
1504error.VerifyThrowInvalidOperation(propertyElement != null,
1506error.VerifyThrowInvalidOperation(propertyElement.ParentNode == this.propertyGroupElement,
1526ErrorUtilities.VerifyThrow(pass == ProcessingPass.Pass1, "Pass should be Pass1 for PropertyGroups.");
Shared\FileUtilities.cs (10)
314ErrorUtilities.VerifyThrow(itemSpec != null, "Need item-spec to modify.");
315ErrorUtilities.VerifyThrow(modifier != null, "Need modifier to apply to item-spec.");
322ErrorUtilities.VerifyThrow((string)cachedModifiers[String.Empty] == itemSpec,
413ErrorUtilities.VerifyThrow((modifiedItemSpec.Length > root.Length) && IsSlash(modifiedItemSpec[root.Length]),
486ErrorUtilities.VerifyThrow(false, "\"{0}\" is not a valid item-spec modifier.", modifier);
496ErrorUtilities.VerifyThrowInvalidOperation(false, "Shared.InvalidFilespecForTransform", modifier, itemSpec, e.Message);
499ErrorUtilities.VerifyThrow(modifiedItemSpec != null, "The item-spec modifier \"{0}\" was not evaluated.", modifier);
802ErrorUtilities.VerifyThrowArgumentNull(basePath, nameof(basePath));
803ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path));
835ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path));