BackEnd\BuildManager\BuildManager.cs (22)
291ErrorUtilities.VerifyThrowArgumentNull(hostName);
859ErrorUtilities.VerifyThrow(configuration.Project != null, "Configuration should have been loaded.");
892ErrorUtilities.VerifyThrowArgumentNull(requestData);
978ErrorUtilities.VerifyThrow(_buildSubmissions.Count == 0, "All submissions not yet complete.");
979ErrorUtilities.VerifyThrow(_activeNodes.Count == 0, "All nodes not yet shut down.");
1234ErrorUtilities.VerifyThrowArgumentNull(submission);
1235ErrorUtilities.VerifyThrow(!submission.IsCompleted, "Submission already complete.");
1251ErrorUtilities.VerifyThrowArgument(
1274ErrorUtilities.VerifyThrow(
1348ErrorUtilities.VerifyThrow(resolvedConfiguration is not null, "Cannot call project cache without having BuildRequestConfiguration");
1469ErrorUtilities.VerifyThrow(FileUtilities.IsSolutionFilename(config.ProjectFullPath), "{0} is not a solution", config.ProjectFullPath);
1641ErrorUtilities.ThrowInternalError("Unexpected packet received by BuildManager: {0}", packet.Type);
1961ErrorUtilities.VerifyThrow(
2112ErrorUtilities.ThrowInvalidOperation(exceptionResouorce);
2121ErrorUtilities.VerifyThrowInvalidOperation(_buildManagerState == requiredState, exceptionResouorce);
2131ErrorUtilities.ThrowInternalError("Expected state {0}, actual state {1}", requiredState, _buildManagerState);
2473ErrorUtilities.VerifyThrow(_activeNodes.Contains(node), "Unexpected shutdown from node {0} which shouldn't exist.", node);
2676ErrorUtilities.ThrowInternalError("Scheduling action {0} not handled.", response.Action);
3085ErrorUtilities.ThrowInternalError("Incorrect packet type: {0} should have been {1}", packet.Type, expectedType);
3172ErrorUtilities.VerifyThrowInternalNull(inputCacheFiles);
3173ErrorUtilities.VerifyThrow(_configCache == null, "caches must not be set at this point");
3174ErrorUtilities.VerifyThrow(_resultsCache == null, "caches must not be set at this point");
BackEnd\BuildManager\LegacyThreadingData.cs (8)
58ErrorUtilities.VerifyThrow(_instanceForMainThread == null || (_instanceForMainThread != null && value == null) || (_instanceForMainThread == value), "Should not assign to instanceForMainThread twice without cleaning it");
91ErrorUtilities.VerifyThrow(!_legacyThreadingEventsById.ContainsKey(submissionId), "Submission {0} should not already be registered with LegacyThreadingData", submissionId);
107ErrorUtilities.VerifyThrow(_legacyThreadingEventsById.ContainsKey(submissionId), "Submission {0} should have been previously registered with LegacyThreadingData", submissionId);
130ErrorUtilities.VerifyThrow(legacyThreadingEvents != null, "We're trying to wait on the legacy thread for submission {0}, but that submission has not been registered.", submissionId);
148ErrorUtilities.VerifyThrow(legacyThreadingEvents != null, "We're trying to track when the legacy thread for submission {0} goes inactive, but that submission has not been registered.", submissionId);
158ErrorUtilities.VerifyThrow(
171ErrorUtilities.VerifyThrow(legacyThreadingEvents != null, "We're trying to signal that the legacy thread is ready for submission {0} to execute, but that submission has not been registered", submissionId);
193ErrorUtilities.VerifyThrow(legacyThreadingEvents != null, "We're trying to signal that submission {0} is done with the legacy thread, but that submission has not been registered", submissionId);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (26)
190ErrorUtilities.VerifyThrow(_componentHost != null, "BuildRequestEngine not initialized by component host.");
191ErrorUtilities.VerifyThrow(_status == BuildRequestEngineStatus.Uninitialized, "Engine must be in the Uninitiailzed state, but is {0}", _status);
216ErrorUtilities.VerifyThrow(_status == BuildRequestEngineStatus.Active || _status == BuildRequestEngineStatus.Idle || _status == BuildRequestEngineStatus.Waiting, "Engine must be Active, Idle or Waiting to clean up, but is {0}.", _status);
218ErrorUtilities.VerifyThrow(_nodeLoggingContext != null, "Node logging context not set.");
302ErrorUtilities.ThrowInternalError("Failure during engine shutdown. Exception: {0}", e.ToString());
330ErrorUtilities.VerifyThrow(_status != BuildRequestEngineStatus.Shutdown && _status != BuildRequestEngineStatus.Uninitialized, "Engine loop not yet started, status is {0}.", _status);
333ErrorUtilities.VerifyThrow(!_requestsByGlobalRequestId.ContainsKey(request.GlobalRequestId), "Request {0} is already known to the engine.", request.GlobalRequestId);
334ErrorUtilities.VerifyThrow(_configCache.HasConfiguration(request.ConfigurationId), "Request {0} refers to configuration {1} which is not known to the engine.", request.GlobalRequestId, request.ConfigurationId);
400ErrorUtilities.VerifyThrow(_status != BuildRequestEngineStatus.Shutdown && _status != BuildRequestEngineStatus.Uninitialized, "Engine loop not yet started, status is {0}.", _status);
401ErrorUtilities.VerifyThrow(_requestsByGlobalRequestId.ContainsKey(unblocker.BlockedRequestId), "Request {0} is not known to the engine.", unblocker.BlockedRequestId);
501ErrorUtilities.VerifyThrow(_status != BuildRequestEngineStatus.Shutdown && _status != BuildRequestEngineStatus.Uninitialized, "Engine loop not yet started, status is {0}.", _status);
504ErrorUtilities.VerifyThrow(_componentHost != null, "No host object set");
593ErrorUtilities.VerifyThrowArgumentNull(host);
594ErrorUtilities.VerifyThrow(_componentHost == null, "BuildRequestEngine already initialized!");
612ErrorUtilities.VerifyThrow(_status == BuildRequestEngineStatus.Uninitialized, "Cleanup wasn't called, status is {0}", _status);
625ErrorUtilities.VerifyThrow(type == BuildComponentType.RequestEngine, "Cannot create component of type {0}", type);
734ErrorUtilities.VerifyThrow(activeEntry == null, "Multiple active requests");
760ErrorUtilities.ThrowInternalError("Unexpected BuildRequestEntry state " + currentEntry.State);
915ErrorUtilities.VerifyThrow(_componentHost != null, "No host object set");
1115ErrorUtilities.VerifyThrow(_componentHost != null, "No host object set");
1279ErrorUtilities.VerifyThrow((requestsToIssue == null) || (requestsToIssue.Count == 0), "Entry shouldn't be ready if we also issued requests.");
1332ErrorUtilities.VerifyThrow(config.WasGeneratedByNode, "InvalidConfigurationId");
1333ErrorUtilities.VerifyThrowArgumentNull(config);
1334ErrorUtilities.VerifyThrow(_unresolvedConfigurations.HasConfiguration(config.ConfigurationId), "NoUnresolvedConfiguration");
1345ErrorUtilities.VerifyThrowArgumentNull(blocker);
1400ErrorUtilities.ThrowInternalError(e.Message, e);
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (24)
125ErrorUtilities.VerifyThrowArgumentNull(request);
126ErrorUtilities.VerifyThrowArgumentNull(requestConfiguration);
127ErrorUtilities.VerifyThrow(requestConfiguration.ConfigurationId == request.ConfigurationId, "Configuration id mismatch");
184ErrorUtilities.VerifyThrow(value == null || _requestBuilder == null, "Request Builder already set.");
195ErrorUtilities.VerifyThrow(configuration.WasGeneratedByNode, "Configuration has already been resolved.");
217ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Active, "Must be in Active state to wait for blocking request. Config: {0} State: {1}", RequestConfiguration.ConfigurationId, State);
306ErrorUtilities.VerifyThrowArgumentNull(result);
307ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Waiting || _outstandingRequests == null, "Entry must be in the Waiting state to report results, or we must have flushed our requests due to an error. Config: {0} State: {1} Requests: {2}", RequestConfiguration.ConfigurationId, State, _outstandingRequests != null);
334ErrorUtilities.VerifyThrow(result.CircularDependency, "Received result for target in progress and it wasn't a circular dependency error.");
366ErrorUtilities.VerifyThrow(!_outstandingResults.ContainsKey(result.NodeRequestId), "Request already contains results.");
385ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Waiting, "Entry must be in the waiting state to be unblocked. Config: {0} State: {1} Request: {2}", RequestConfiguration.ConfigurationId, State, Request.GlobalRequestId);
386ErrorUtilities.VerifyThrow(_blockingGlobalRequestId != BuildRequest.InvalidGlobalRequestId, "Entry must be waiting on another request to be unblocked. Config: {0} Request: {1}", RequestConfiguration.ConfigurationId, Request.GlobalRequestId);
403ErrorUtilities.VerifyThrow(_unresolvedConfigurations == null, "All configurations must be resolved before Continue may be called.");
404ErrorUtilities.VerifyThrow(_outstandingRequests == null, "All outstanding requests must have been satisfied.");
405ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Ready, "Entry must be in the Ready state. Config: {0} State: {1}", RequestConfiguration.ConfigurationId, State);
474ErrorUtilities.VerifyThrowArgumentNull(result);
475ErrorUtilities.VerifyThrow(Result == null, "Entry already Completed.");
482ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Active, "Entry must be active before it can be Completed successfully. Config: {0} State: {1}", RequestConfiguration.ConfigurationId, State);
483ErrorUtilities.VerifyThrow(_unresolvedConfigurations == null, "Entry must not have any unresolved configurations.");
484ErrorUtilities.VerifyThrow(_outstandingRequests == null, "Entry must have no outstanding requests.");
485ErrorUtilities.VerifyThrow(_outstandingResults == null, "Results must be consumed before request may be completed.");
500ErrorUtilities.VerifyThrow(State == BuildRequestEntryState.Active || State == BuildRequestEntryState.Waiting, "Must be in Active or Waiting state to wait for results. Config: {0} State: {1}", RequestConfiguration.ConfigurationId, State);
506ErrorUtilities.VerifyThrow(!_outstandingRequests.ContainsKey(newRequest.NodeRequestId), "Already waiting for local request {0}", newRequest.NodeRequestId);
511ErrorUtilities.VerifyThrow(addToIssueList, "Requests with unresolved configurations should always be added to the issue list.");
BackEnd\Components\Communications\NodeEndpointInProc.cs (19)
104ErrorUtilities.VerifyThrowArgumentNull(host);
165ErrorUtilities.VerifyThrowInternalNull(factory);
183ErrorUtilities.VerifyThrowInternalNull(factory);
213ErrorUtilities.VerifyThrow(_status == LinkStatus.Active, "Cannot send when link status is not active. Current status {0}", _status);
304ErrorUtilities.VerifyThrow(_status == LinkStatus.Active, "Endpoint is not connected. Current status {0}", _status);
321ErrorUtilities.VerifyThrow(_status != newStatus, "Attempting to change status to existing status {0}.", _status);
334ErrorUtilities.VerifyThrowArgumentNull(packet);
335ErrorUtilities.VerifyThrow(_mode == EndpointMode.Asynchronous, "EndPoint mode is synchronous, should be asynchronous");
336ErrorUtilities.VerifyThrow(_packetQueue != null, "packetQueue is null");
337ErrorUtilities.VerifyThrow(_packetAvailable != null, "packetAvailable is null");
350ErrorUtilities.VerifyThrow(_packetPump == null, "packetPump != null");
351ErrorUtilities.VerifyThrow(_packetAvailable == null, "packetAvailable != null");
352ErrorUtilities.VerifyThrow(_terminatePacketPump == null, "terminatePacketPump != null");
353ErrorUtilities.VerifyThrow(_packetQueue == null, "packetQueue != null");
387ErrorUtilities.VerifyThrow(_packetPump != null, "packetPump == null");
388ErrorUtilities.VerifyThrow(_packetAvailable != null, "packetAvailable == null");
389ErrorUtilities.VerifyThrow(_terminatePacketPump != null, "terminatePacketPump == null");
390ErrorUtilities.VerifyThrow(_packetQueue != null, "packetQueue == null");
446ErrorUtilities.ThrowInternalError("waitId {0} out of range.", waitId);
BackEnd\Components\Communications\NodeProviderInProc.cs (12)
159ErrorUtilities.VerifyThrowArgumentOutOfRange(nodeId == _inProcNodeId, "node");
160ErrorUtilities.VerifyThrowArgumentNull(packet);
220ErrorUtilities.VerifyThrow(nodeId != InvalidInProcNodeId, "Cannot create in-proc node.");
273ErrorUtilities.ThrowInternalErrorUnreachable();
282ErrorUtilities.ThrowInternalErrorUnreachable();
291ErrorUtilities.ThrowInternalErrorUnreachable();
352ErrorUtilities.VerifyThrow(type == BuildComponentType.InProcNodeProvider, "Cannot create component of type {0}", type);
363ErrorUtilities.VerifyThrow(_inProcNode == null, "In Proc node already instantiated.");
364ErrorUtilities.VerifyThrow(_inProcNodeEndpoint == null, "In Proc node endpoint already instantiated.");
397ErrorUtilities.VerifyThrow(connected, "In-proc node failed to start up within {0}ms", connectionTimeout);
422ErrorUtilities.VerifyThrow(endpoint == _inProcNodeEndpoint, "Received link status event for a node other than our peer.");
442ErrorUtilities.ThrowInternalError("Unexpected shutdown code {0} received.", reason);
BackEnd\Components\Logging\LoggingService.cs (18)
856ErrorUtilities.VerifyThrow(_serviceState != LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
857ErrorUtilities.VerifyThrow(buildComponentHost != null, "BuildComponentHost was null");
892ErrorUtilities.VerifyThrow(_serviceState != LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
962ErrorUtilities.VerifyThrow(packet != null, "packet was null");
968ErrorUtilities.ThrowInternalError("Expected packet type \"{0}\" but instead got packet type \"{1}\".", nameof(NodePacketType.LogMessage), packet.Type.ToString());
1038ErrorUtilities.VerifyThrow(_serviceState != LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1039ErrorUtilities.VerifyThrow(logger != null, "logger was null");
1127ErrorUtilities.VerifyThrow(_serviceState != LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1128ErrorUtilities.VerifyThrow(forwardingLogger != null, "forwardingLogger was null");
1192ErrorUtilities.VerifyThrow(_serviceState != LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1193ErrorUtilities.VerifyThrow(forwardingLoggerSink != null, "forwardingLoggerSink was null");
1194ErrorUtilities.VerifyThrow(descriptions != null, "loggerDescriptions was null");
1195ErrorUtilities.VerifyThrow(descriptions.Count > 0, "loggerDescriptions was null");
1247ErrorUtilities.VerifyThrow(buildEvent != null, "buildEvent is null");
1298ErrorUtilities.VerifyThrow(buildEvent != null, "buildEvent is null");
1348ErrorUtilities.VerifyThrow(_configCache.Value.HasConfiguration(projectStartedEventArgs.ProjectId), "Cannot find the project configuration while injecting non-serialized data from out-of-proc node.");
1557ErrorUtilities.ThrowInternalError("Unknown logging item in queue:" + loggingEvent.GetType().FullName);
1937ErrorUtilities.ThrowInternalError("ContextID {0} should have been in the ID-to-project file mapping but wasn't!", context.ProjectContextId);
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (31)
41ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(messageResourceName), "Need resource string for comment message.");
113ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(messageResourceName), "Need resource string for error message.");
138ErrorUtilities.VerifyThrow(projectFile != null, "ContextID {0} should have been in the ID-to-project file mapping but wasn't!", buildEventContext.ProjectContextId);
156ErrorUtilities.VerifyThrow(invalidProjectFileException != null, "Need exception context.");
157ErrorUtilities.VerifyThrow(buildEventContext != null, "buildEventContext is null");
178ErrorUtilities.VerifyThrow(projectFile != null, "ContextID {0} should have been in the ID-to-project file mapping but wasn't!", buildEventContext.ProjectContextId);
210ErrorUtilities.VerifyThrow(taskName != null, "Must specify the name of the task that failed.");
227ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(messageResourceName), "Need resource string for error message.");
261ErrorUtilities.VerifyThrow(!String.IsNullOrEmpty(taskName), "Must specify the name of the task that failed.");
286ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(messageResourceName), "Need resource string for warning message.");
303ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file.");
304ErrorUtilities.VerifyThrow(message != null, "Need warning message.");
305ErrorUtilities.VerifyThrow(buildEventContext != null, "Need a BuildEventContext");
330ErrorUtilities.VerifyThrow(projectFile != null, "ContextID {0} should have been in the ID-to-project file mapping but wasn't!", buildEventContext.ProjectContextId);
458ErrorUtilities.VerifyThrow(projectEvaluationEventContext != null, "projectBuildEventContext");
534ErrorUtilities.VerifyThrow(nodeBuildEventContext != null, "Need a nodeBuildEventContext");
543ErrorUtilities.ThrowInternalError("ContextID {0} for project {1} should not already be in the ID-to-file mapping!", projectContextId, projectFile);
555ErrorUtilities.ThrowInternalError("ContextID {0} was already in the ID-to-project file mapping but the project file {1} did not match the provided one {2}!", projectContextId, existingProjectFile, projectFile);
565ErrorUtilities.ThrowInternalError("ContextID {0} should have been in the ID-to-project file mapping but wasn't!", projectContextId);
574ErrorUtilities.VerifyThrow(parentBuildEventContext != null, "Need a parentBuildEventContext");
576ErrorUtilities.VerifyThrow(_configCache.Value.HasConfiguration(configurationId), "Cannot find the project configuration while injecting non-serialized data from out-of-proc node.");
608ErrorUtilities.VerifyThrow(projectBuildEventContext != null, "projectBuildEventContext");
621ErrorUtilities.ThrowInternalError("ContextID {0} for project {1} should be in the ID-to-file mapping!", projectBuildEventContext.ProjectContextId, projectFile);
638ErrorUtilities.VerifyThrow(projectBuildEventContext != null, "projectBuildEventContext is null");
679ErrorUtilities.VerifyThrow(targetBuildEventContext != null, "targetBuildEventContext is null");
706ErrorUtilities.VerifyThrow(taskBuildEventContext != null, "targetBuildEventContext is null");
735ErrorUtilities.VerifyThrow(targetBuildEventContext != null, "targetBuildEventContext is null");
775ErrorUtilities.VerifyThrow(taskBuildEventContext != null, "taskBuildEventContext is null");
801ErrorUtilities.VerifyThrow(eventName != null, "eventName is null");
823ErrorUtilities.VerifyThrow(buildEventContext != null, "buildEventContext was null");
824ErrorUtilities.VerifyThrow(filePath != null, "response file path was null");
BackEnd\Components\ProjectCache\ProjectCacheService.cs (8)
218ErrorUtilities.VerifyThrowArgumentNull(projectCacheDescriptor.PluginAssemblyPath, nameof(projectCacheDescriptor.PluginAssemblyPath));
481ErrorUtilities.VerifyThrow(submission.BuildRequestData != null,
504ErrorUtilities.VerifyThrowInternalNull(buildRequest.ProjectInstance, nameof(buildRequest.ProjectInstance));
541ErrorUtilities.VerifyThrow(plugin.Instance != null, "Plugin '{0}' instance is null", plugin.Name);
672ErrorUtilities.VerifyThrowInternalNull(projectConfiguration.Attributes, nameof(projectConfiguration.Attributes));
684ErrorUtilities.VerifyThrow(projectPathAttribute is not null, "Expected VS to set the project path on each ProjectConfiguration element.");
712ErrorUtilities.VerifyThrowInternalNull(requestConfiguration.Project, nameof(requestConfiguration.Project));
771ErrorUtilities.VerifyThrow(plugin.Instance != null, "Plugin '{0}' instance is null", plugin.Name);
BackEnd\Components\RequestBuilder\Lookup.cs (12)
94ErrorUtilities.VerifyThrowInternalNull(projectItems);
95ErrorUtilities.VerifyThrowInternalNull(properties);
263ErrorUtilities.VerifyThrow(_lookupScopes.Count >= 2, "Too many calls to Leave().");
264ErrorUtilities.VerifyThrow(Object.ReferenceEquals(scopeToLeave, _lookupScopes.First.Value), "Attempting to leave with scope '{0}' but scope '{1}' is on top of the stack.", scopeToLeave.Description, _lookupScopes.First.Value.Description);
455ErrorUtilities.VerifyThrowInternalLength(name, nameof(name));
602ErrorUtilities.VerifyThrow(existing.Count == 0, "Cannot add an itemgroup of this type.");
833ErrorUtilities.VerifyThrow(!_cloneTable.ContainsKey(cloneItem), "Should be new, not already in table!");
960ErrorUtilities.VerifyThrow(!tableOfItemsOfSameType.Contains(item), "Item should not be in table");
975ErrorUtilities.VerifyThrow(!tableOfItemsOfSameType.ContainsKey(item), "Item should not be in table");
1007ErrorUtilities.VerifyThrow(_lookupScopes.Count > 1, "Operation in outer scope not supported");
1182ErrorUtilities.VerifyThrowInternalNull(value, "value");
1240ErrorUtilities.VerifyThrow(modificationType != ModificationType.Update, "Modification type may only be update when a value is specified.");
BackEnd\Components\RequestBuilder\RequestBuilder.cs (43)
199ErrorUtilities.VerifyThrowArgumentNull(loggingContext);
200ErrorUtilities.VerifyThrowArgumentNull(entry);
201ErrorUtilities.VerifyThrow(_componentHost != null, "Host not set.");
202ErrorUtilities.VerifyThrow(_targetBuilder == null, "targetBuilder not null");
203ErrorUtilities.VerifyThrow(_nodeLoggingContext == null, "nodeLoggingContext not null");
204ErrorUtilities.VerifyThrow(_requestEntry == null, "requestEntry not null");
205ErrorUtilities.VerifyThrow(!_terminateEvent.WaitOne(0), "Cancel already called");
225ErrorUtilities.VerifyThrow(HasActiveBuildRequest, "Request not building");
226ErrorUtilities.VerifyThrow(!_terminateEvent.WaitOne(0), "Request already terminated");
227ErrorUtilities.VerifyThrow(!_continueEvent.WaitOne(0), "Request already continued");
231ErrorUtilities.VerifyThrow(_blockType == BlockType.BlockedOnTargetInProgress || _blockType == BlockType.Yielded || (_continueResults != null), "Unexpected null results for request {0} (nr {1})", _requestEntry.Request.GlobalRequestId, _requestEntry.Request.NodeRequestId);
242ErrorUtilities.VerifyThrow(HasActiveBuildRequest, "Request not building");
243ErrorUtilities.VerifyThrow(!_terminateEvent.WaitOne(0), "Request already terminated");
244ErrorUtilities.VerifyThrow(_pendingResourceRequests.Any(), "No pending resource requests");
306ErrorUtilities.ThrowInvalidOperation("UnableToCancel");
335ErrorUtilities.VerifyThrowArgumentNull(projectFiles);
336ErrorUtilities.VerifyThrowArgumentNull(properties);
337ErrorUtilities.VerifyThrowArgumentNull(targets);
338ErrorUtilities.VerifyThrowArgumentNull(toolsVersions);
339ErrorUtilities.VerifyThrow(_componentHost != null, "No host object set");
340ErrorUtilities.VerifyThrow(projectFiles.Length == properties.Length, "Properties and project counts not the same");
341ErrorUtilities.VerifyThrow(projectFiles.Length == toolsVersions.Length, "Tools versions and project counts not the same");
384ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests");
474ErrorUtilities.VerifyThrow(!_inMSBuildCallback, "Already in an MSBuild callback!");
484ErrorUtilities.VerifyThrow(_inMSBuildCallback, "Not in an MSBuild callback!");
493ErrorUtilities.VerifyThrow(Monitor.IsEntered(monitorLockObject), "Not running under the given lock");
553ErrorUtilities.VerifyThrowArgumentNull(host);
554ErrorUtilities.VerifyThrow(_componentHost == null, "RequestBuilder already initialized.");
630ErrorUtilities.VerifyThrow(type == BuildComponentType.RequestBuilder, "Cannot create components of type {0}", type);
639ErrorUtilities.VerifyThrow(_requestTask == null, "Already have a task.");
681ErrorUtilities.VerifyThrow(_componentHost.LegacyThreadingData.MainThreadSubmissionId != _requestEntry.Request.SubmissionId, "Can't start builder thread when we are using legacy threading semantics for this request.");
746ErrorUtilities.VerifyThrow(_requestEntry.State == BuildRequestEntryState.Ready, "Entry is not in the Ready state, it is in the {0} state.", _requestEntry.State);
754ErrorUtilities.VerifyThrow(_requestEntry.State == BuildRequestEntryState.Active, "Entry is not in the Active state, it is in the {0} state.", _requestEntry.State);
762ErrorUtilities.VerifyThrow(_requestEntry.State == BuildRequestEntryState.Active || _requestEntry.State == BuildRequestEntryState.Waiting,
855ErrorUtilities.ThrowInternalError(ex.Message, ex);
865ErrorUtilities.VerifyThrow(result == null, "Result already set when exception was thrown.");
997ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests");
1015ErrorUtilities.VerifyThrow(!isContinue, "Unexpected null results during continue");
1106ErrorUtilities.VerifyThrow(_targetBuilder != null, "Target builder is null");
1200ErrorUtilities.VerifyThrow(
1321ErrorUtilities.VerifyThrow(_requestEntry.RequestConfiguration.SavedCurrentDirectory != null, "Current directory not previously saved.");
1322ErrorUtilities.VerifyThrow(_requestEntry.RequestConfiguration.SavedEnvironmentVariables != null, "Current environment not previously saved.");
1377ErrorUtilities.VerifyThrow(!_isZombie, "RequestBuilder has been zombied.");
BackEnd\Components\RequestBuilder\TargetBuilder.cs (14)
105ErrorUtilities.VerifyThrowArgumentNull(loggingContext, "projectLoggingContext");
106ErrorUtilities.VerifyThrowArgumentNull(entry);
107ErrorUtilities.VerifyThrowArgumentNull(callback, "requestBuilderCallback");
108ErrorUtilities.VerifyThrowArgumentNull(targetNames);
109ErrorUtilities.VerifyThrowArgumentNull(baseLookup);
110ErrorUtilities.VerifyThrow(targetNames.Length > 0, "List of targets must be non-empty");
111ErrorUtilities.VerifyThrow(_componentHost != null, "InitializeComponent must be called before building targets.");
215ErrorUtilities.VerifyThrowArgumentNull(host);
280ErrorUtilities.VerifyThrow(pushed, "Failed to push any targets onto the stack. Target: {0} Current Target: {1}", targets[i], currentTargetEntry.Target.Name);
333ErrorUtilities.ThrowInternalError("This method should never be called by anyone except the TargetBuilder.");
394ErrorUtilities.VerifyThrow(type == BuildComponentType.TargetBuilder, "Cannot create components of type {0}", type);
479ErrorUtilities.VerifyThrow(!wasActivelyBuilding, "Target {0} was actively building and waited on but we are attempting to build it again.", currentTargetEntry.Name);
537ErrorUtilities.ThrowInternalError("Unexpected target state {0}", currentTargetEntry.State);
552ErrorUtilities.VerifyThrowInternalNull(targetResult, "targetResult");
BackEnd\Components\RequestBuilder\TargetEntry.cs (13)
178ErrorUtilities.VerifyThrowArgumentNull(requestEntry);
179ErrorUtilities.VerifyThrowArgumentNull(targetBuilderCallback);
180ErrorUtilities.VerifyThrowArgumentNull(targetSpecification, "targetName");
181ErrorUtilities.VerifyThrowArgumentNull(baseLookup, "lookup");
182ErrorUtilities.VerifyThrowArgumentNull(host);
425ErrorUtilities.VerifyThrow(!_isExecuting, "Target {0} is already executing", _target.Name);
700ErrorUtilities.VerifyThrow(_legacyCallTargetScopes == null, "We should have already left any legacy call target scopes.");
747ErrorUtilities.VerifyThrow(_legacyCallTargetScopes == null, "We should have already left any legacy call target scopes.");
772ErrorUtilities.VerifyThrow(_state != TargetEntryState.Completed, "State must not be Completed. State is {0}.", _state);
783ErrorUtilities.VerifyThrow(_state == TargetEntryState.Completed, "State must be Completed. State is {0}.", _state);
784ErrorUtilities.VerifyThrow(_targetResult.ResultCode == TargetResultCode.Skipped, "ResultCode must be Skipped. ResultCode is {0}.", _state);
785ErrorUtilities.VerifyThrow(_targetResult.WorkUnitResult.ActionCode == WorkUnitActionCode.Continue, "ActionCode must be Continue. ActionCode is {0}.", _state);
899ErrorUtilities.VerifyThrow(actual == expected, "Expected state {1}. Got {0}", actual, expected);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (24)
57ErrorUtilities.VerifyThrow(project != null, "Need a project.");
58ErrorUtilities.VerifyThrow(targetToAnalyze != null, "Need a target to analyze.");
92ErrorUtilities.VerifyThrow(_targetInputSpecification != null, "targetInputSpecification is null");
105ErrorUtilities.VerifyThrow(_targetOutputSpecification != null, "targetOutputSpecification is null");
204ErrorUtilities.VerifyThrow(itemVectorsReferencedInBothTargetInputsAndOutputs.Count > 0, "The target must have inputs.");
205ErrorUtilities.VerifyThrow(!IsItemVectorEmpty(itemVectorsInTargetInputs), "The target must have inputs.");
609ErrorUtilities.VerifyThrow(inputItemVectors.Count == 1,
713ErrorUtilities.VerifyThrow(numberOfInputItemVectorsWithAllChangedItems <= itemVectorsReferencedInBothTargetInputsAndOutputs.Count,
719ErrorUtilities.VerifyThrow(result == DependencyAnalysisResult.IncrementalBuild,
849ErrorUtilities.VerifyThrow(!itemVectorCollection[itemVectorType].ContainsKey(item), "ItemVectorPartition already contains a vector for items with the expression '{0}'", item);
852ErrorUtilities.VerifyThrow((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorPartition.Count == 1),
963ErrorUtilities.VerifyThrow((inputs.Count > 0) && (outputs.Count > 0), "Need to specify inputs and outputs.");
966ErrorUtilities.VerifyThrow(inputs[0] is string || inputs[0] is ProjectItemInstance, "Must be either string or ProjectItemInstance");
971ErrorUtilities.VerifyThrow(outputs[0] is string || outputs[0] is ProjectItemInstance, "Must be either string or ProjectItemInstance");
982ErrorUtilities.ThrowIfTypeDoesNotImplementToString(outputs[0]);
1000ErrorUtilities.ThrowIfTypeDoesNotImplementToString(inputs[0]);
1008ErrorUtilities.ThrowIfTypeDoesNotImplementToString(outputs[i]);
1026ErrorUtilities.ThrowIfTypeDoesNotImplementToString(inputs[0]);
1043ErrorUtilities.ThrowIfTypeDoesNotImplementToString(input);
1086ErrorUtilities.VerifyThrow(inputs[0] is string || inputs[0] is ProjectItemInstance, "Must be either string or ProjectItemInstance");
1091ErrorUtilities.VerifyThrow(outputs[0] is string || outputs[0] is ProjectItemInstance, "Must be either string or ProjectItemInstance");
1099ErrorUtilities.ThrowIfTypeDoesNotImplementToString(input);
1107ErrorUtilities.ThrowIfTypeDoesNotImplementToString(output);
1199ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(path1) && !string.IsNullOrEmpty(path2),
BackEnd\Components\RequestBuilder\TaskHost.cs (22)
117ErrorUtilities.VerifyThrowArgumentNull(host);
118ErrorUtilities.VerifyThrowArgumentNull(requestEntry);
119ErrorUtilities.VerifyThrowInternalNull(taskLocation);
291ErrorUtilities.VerifyThrowArgument((targetOutputsPerProject == null) || (projectFileNames.Length == targetOutputsPerProject.Length), "General.TwoVectorsMustHaveSameLength", projectFileNames.Length, targetOutputsPerProject?.Length ?? 0, "projectFileNames", "targetOutputsPerProject");
299ErrorUtilities.VerifyThrow(targetOutputsPerProject.Length == result.TargetOutputsPerProject.Count, "{0} != {1}", targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count);
359ErrorUtilities.VerifyThrow(_yieldThreadId == -1, "Cannot call Yield() while yielding.");
388ErrorUtilities.VerifyThrow(_yieldThreadId != -1, "Cannot call Reacquire() before Yield().");
389ErrorUtilities.VerifyThrow(_yieldThreadId == Thread.CurrentThread.ManagedThreadId, "Cannot call Reacquire() on thread {0} when Yield() was called on thread {1}", Thread.CurrentThread.ManagedThreadId, _yieldThreadId);
411ErrorUtilities.VerifyThrowArgumentNull(e);
481ErrorUtilities.VerifyThrowArgumentNull(e);
522ErrorUtilities.VerifyThrowArgumentNull(e);
563ErrorUtilities.VerifyThrowArgumentNull(e);
654ErrorUtilities.VerifyThrowArgumentNull(eventName);
813ErrorUtilities.VerifyThrowArgumentOutOfRange(requestedCores > 0, nameof(requestedCores));
860ErrorUtilities.VerifyThrowArgumentOutOfRange(coresToRelease > 0, nameof(coresToRelease));
968ErrorUtilities.VerifyThrowArgumentNull(projectFileNames);
969ErrorUtilities.VerifyThrowArgumentNull(globalProperties);
1141ErrorUtilities.VerifyThrowArgumentNull(projectFileNames);
1142ErrorUtilities.VerifyThrowArgumentNull(globalProperties);
1214ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length, "{0}!={1}.", results.Length, projectFileNames.Length);
1259ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length || !overallSuccess, "The number of results returned {0} cannot be less than the number of project files {1} unless one of the results indicated failure.", results.Length, projectFileNames.Length);
1274ErrorUtilities.VerifyThrow(_activeProxy, "Attempted to use an inactive task host.");
BackEnd\Components\Scheduler\SchedulableRequest.cs (26)
129ErrorUtilities.VerifyThrowArgumentNull(collection);
130ErrorUtilities.VerifyThrowArgumentNull(request);
131ErrorUtilities.VerifyThrow((parent == null) || (parent._schedulingData == collection), "Parent request does not belong to the same collection.");
256ErrorUtilities.VerifyThrow(_creationTime == DateTime.MinValue, "Cannot set CreationTime twice.");
273ErrorUtilities.VerifyThrow(_startTime == DateTime.MinValue, "Cannot set StartTime twice.");
290ErrorUtilities.VerifyThrow(_endTime == DateTime.MinValue, "Cannot set EndTime twice.");
314ErrorUtilities.VerifyThrowArgumentNull(activeTargets);
338ErrorUtilities.VerifyThrowArgumentNull(blockingRequest);
339ErrorUtilities.VerifyThrowArgumentNull(activeTargets);
340ErrorUtilities.VerifyThrow(BlockingTarget == null, "Cannot block again if we're already blocked on a target");
345ErrorUtilities.VerifyThrow(!_requestsWeAreBlockedBy.ContainsKey(key), "We are already blocked by this request.");
346ErrorUtilities.VerifyThrow(!blockingRequest._requestsWeAreBlocking.Contains(this), "The blocking request thinks it is already blocking us.");
375ErrorUtilities.VerifyThrowArgumentNull(result);
388ErrorUtilities.VerifyThrowArgumentNull(result);
401ErrorUtilities.VerifyThrow(_assignedNodeId == Scheduler.InvalidNodeId || _assignedNodeId == nodeId, "Request must always resume on the same node on which it was started.");
404ErrorUtilities.VerifyThrow((_state == SchedulableRequestState.Ready) || !_schedulingData.IsRequestScheduled(this), "Another instance of request {0} is already scheduled.", _request.GlobalRequestId);
405ErrorUtilities.VerifyThrow(!_schedulingData.IsNodeWorking(nodeId), "Cannot resume execution of request {0} because node {1} is already working.", _request.GlobalRequestId, nodeId);
408ErrorUtilities.VerifyThrow(requiredNodeId == Scheduler.InvalidNodeId || requiredNodeId == nodeId, "Request {0} cannot be assigned to node {1} because its configuration is already assigned to node {2}", _request.GlobalRequestId, nodeId, requiredNodeId);
420ErrorUtilities.VerifyThrow(_state != SchedulableRequestState.Ready || result.CircularDependency, "Request can only be Completed from the Ready state if the result indicates a circular dependency occurred.");
421ErrorUtilities.VerifyThrow(_requestsWeAreBlockedBy.Count == 0, "We can't be complete if we are still blocked on requests.");
439ErrorUtilities.VerifyThrow(_requestsWeAreBlockedBy.Count == 0, "We are blocked by requests.");
440ErrorUtilities.VerifyThrow(_requestsWeAreBlocking.Count == 0, "We are blocking by requests.");
449ErrorUtilities.VerifyThrow(_state == requiredState, "Request {0} expected to be in state {1} but state is actually {2}", _request.GlobalRequestId, requiredState, _state);
465ErrorUtilities.ThrowInternalError("State {0} is not one of the expected states.", _state);
641ErrorUtilities.VerifyThrow(_requestsWeAreBlockedBy.TryGetValue(blockingRequestKey, out SchedulableRequest unblockingRequest), "We are not blocked by the specified request.");
642ErrorUtilities.VerifyThrow(unblockingRequest._requestsWeAreBlocking.Contains(this), "The request unblocking us doesn't think it is blocking us.");
BackEnd\Components\Scheduler\Scheduler.cs (30)
329ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
334ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
343ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should exist");
355ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
401ErrorUtilities.VerifyThrow(result.ParentGlobalRequestId == request.Parent.BuildRequest.GlobalRequestId, "Result's parent doesn't match request's parent.");
506ErrorUtilities.ThrowInternalErrorUnreachable();
651ErrorUtilities.VerifyThrow(componentType == BuildComponentType.Scheduler, "Cannot create components of type {0}", componentType);
758ErrorUtilities.ThrowInternalError("Somehow no requests are currently executing, and at least one of the {0} requests blocked by in-progress requests is servicable by a currently existing node, but no circular dependency was detected ...", _schedulingData.BlockedRequestsCount);
765ErrorUtilities.ThrowInternalError("None of the {0} blocked requests can be serviced by currently existing nodes, but we aren't requesting a new one.", _schedulingData.BlockedRequestsCount);
771ErrorUtilities.ThrowInternalError("Somehow we have {0} requests which are ready to go but we didn't tell the nodes to continue.", _schedulingData.ReadyRequestsCount);
776ErrorUtilities.ThrowInternalError("Somehow we have {0} unassigned build requests but {1} of our nodes are free and we aren't requesting a new one...", _schedulingData.UnscheduledRequestsCount, idleNodes.Count);
781ErrorUtilities.VerifyThrow(responses.Count > 0, "We failed to request a node to be created.");
1357ErrorUtilities.VerifyThrowArgumentNull(request);
1358ErrorUtilities.VerifyThrowArgumentNull(responses);
1359ErrorUtilities.VerifyThrow(nodeId != InvalidNodeId, "Invalid node id specified.");
1374ErrorUtilities.VerifyThrow(config.ResultsNodeId != InvalidNodeId, "Configuration's results node is not set.");
1387ErrorUtilities.VerifyThrow(
1538ErrorUtilities.ThrowInternalErrorUnreachable();
1558ErrorUtilities.VerifyThrow(inProcNodesToCreate == 1, "We should never be trying to create more than one inproc node");
1622ErrorUtilities.VerifyThrowArgumentNull(blockedRequest);
1623ErrorUtilities.VerifyThrowArgumentNull(blocker);
1681ErrorUtilities.VerifyThrowArgumentNull(blocker);
1682ErrorUtilities.VerifyThrowArgumentNull(responses);
1763ErrorUtilities.VerifyThrowInternalError(
1852ErrorUtilities.VerifyThrow(request.Parent == null, "Unexpectedly generated a SubmissionComplete response for a request which is not top-level.");
2036ErrorUtilities.VerifyThrowInternalNull(parentRequest);
2037ErrorUtilities.VerifyThrow(
2115ErrorUtilities.VerifyThrow(parentRequestNode != InvalidNodeId, "Invalid parent node provided.");
2118ErrorUtilities.VerifyThrow(result.ParentGlobalRequestId == requestWhichGeneratedResult.ParentGlobalRequestId, "Result's parent doesn't match request's parent.");
2177ErrorUtilities.VerifyThrow(request.ConfigurationId != BuildRequestConfiguration.InvalidConfigurationId, "Requests should have a valid configuration id at this point");
BackEnd\Components\Scheduler\SchedulingData.cs (15)
293ErrorUtilities.VerifyThrow(_buildHierarchy.ContainsKey(parent), "Parent doesn't exist in build hierarchy for request {0}", request.BuildRequest.GlobalRequestId);
317ErrorUtilities.ThrowInternalError("Should not be updating a request after it has reached the Completed state.");
345ErrorUtilities.VerifyThrow(!requestsAssignedToNode.Contains(request), "Request {0} is already scheduled to node {1}", request.BuildRequest.GlobalRequestId, request.AssignedNode);
369ErrorUtilities.VerifyThrow(!_blockedRequests.ContainsKey(request.BuildRequest.GlobalRequestId), "Request with global id {0} is already blocked!");
374ErrorUtilities.VerifyThrow(!_yieldingRequests.ContainsKey(request.BuildRequest.GlobalRequestId), "Request with global id {0} is already yielded!");
379ErrorUtilities.VerifyThrow(_configurationToRequests.ContainsKey(request.BuildRequest.ConfigurationId), "Configuration {0} never had requests assigned to it.", request.BuildRequest.ConfigurationId);
380ErrorUtilities.VerifyThrow(_configurationToRequests[request.BuildRequest.ConfigurationId].Count > 0, "Configuration {0} has no requests assigned to it.", request.BuildRequest.ConfigurationId);
391ErrorUtilities.VerifyThrow(!_executingRequests.ContainsKey(request.BuildRequest.GlobalRequestId), "Request with global id {0} is already executing!");
392ErrorUtilities.VerifyThrow(!_executingRequestByNode.ContainsKey(request.AssignedNode) || _executingRequestByNode[request.AssignedNode] == null, "Node {0} is currently executing a request.", request.AssignedNode);
405ErrorUtilities.VerifyThrow(!_readyRequests.ContainsKey(request.BuildRequest.GlobalRequestId), "Request with global id {0} is already ready!");
414ErrorUtilities.VerifyThrow(!readyRequestsOnNode.Contains(request), "Request with global id {0} is already marked as ready on node {1}", request.BuildRequest.GlobalRequestId, request.AssignedNode);
419ErrorUtilities.ThrowInternalError("Request with global id {0} cannot transition to the Unscheduled state", request.BuildRequest.GlobalRequestId);
504ErrorUtilities.VerifyThrow(returnValue != null, "Global Request Id {0} has not been assigned and cannot be retrieved.", globalRequestId);
695ErrorUtilities.VerifyThrow(
740ErrorUtilities.ThrowInternalError("Request {0} was expected to be in state {1} but is not scheduled at all (it may be unscheduled or may be unknown to the system.)", globalRequestId, state);
BackEnd\Shared\BuildRequestConfiguration.cs (25)
170ErrorUtilities.VerifyThrowArgumentNull(data);
171ErrorUtilities.VerifyThrowInternalLength(data.ProjectFullPath, "data.ProjectFullPath");
212ErrorUtilities.VerifyThrowArgumentNull(instance);
232ErrorUtilities.VerifyThrow(configId != InvalidConfigurationId, "Configuration ID must not be invalid when using this constructor.");
233ErrorUtilities.VerifyThrowArgumentNull(other);
234ErrorUtilities.VerifyThrow(other._transferredState == null, "Unexpected transferred state still set on other configuration.");
344ErrorUtilities.VerifyThrow((_configId == InvalidConfigurationId) || (WasGeneratedByNode && (value > InvalidConfigurationId)), "Configuration ID must be invalid, or it must be less than invalid and the new config must be greater than invalid. It was {0}, the new value was {1}.", _configId, value);
375ErrorUtilities.VerifyThrow(!IsCached, "We shouldn't be accessing the ProjectInstance when the configuration is cached.");
387ErrorUtilities.VerifyThrow(_transferredProperties == null, "Shouldn't be transferring entire state of ProjectInstance when transferredProperties is not null.");
407ErrorUtilities.VerifyThrow(project != null, "Cannot set null project.");
436ErrorUtilities.VerifyThrow(!IsLoaded, "Already loaded the project for this configuration id {0}.", ConfigurationId);
513ErrorUtilities.VerifyThrow(IsLoaded, $"This {nameof(BuildRequestConfiguration)} must be loaded at the end of this method");
540ErrorUtilities.VerifyThrow(_projectInitialTargets == null, "Initial targets cannot be reset once they have been set.");
556ErrorUtilities.VerifyThrow(_projectDefaultTargets == null, "Default targets cannot be reset once they have been set.");
571ErrorUtilities.VerifyThrow(
590ErrorUtilities.VerifyThrow(!IsCached, "Configuration is cached, we shouldn't be accessing the lookup.");
713ErrorUtilities.ThrowInvalidOperation("CacheFileInaccessible", cacheFile, e);
752ErrorUtilities.ThrowInvalidOperation("CacheFileInaccessible", cacheFile, e);
767ErrorUtilities.VerifyThrow(request.ConfigurationId == ConfigurationId, "Request does not match configuration.");
768ErrorUtilities.VerifyThrow(_projectInitialTargets != null, "Initial targets have not been set.");
769ErrorUtilities.VerifyThrow(_projectDefaultTargets != null, "Default targets have not been set.");
773ErrorUtilities.VerifyThrow(
811ErrorUtilities.VerifyThrowInternalNull(Project);
812ErrorUtilities.VerifyThrowInternalLength(referenceFullPath, nameof(referenceFullPath));
813ErrorUtilities.VerifyThrow(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases");
Construction\ProjectElementContainer.cs (31)
145ErrorUtilities.VerifyThrowArgumentNull(child);
176ErrorUtilities.VerifyThrow(child.NextSibling.PreviousSibling == reference, "Invalid structure");
200ErrorUtilities.VerifyThrowArgumentNull(child);
232ErrorUtilities.VerifyThrow(child.PreviousSibling.NextSibling == reference, "Invalid structure");
256ErrorUtilities.VerifyThrow(FirstChild != null, "Invalid structure");
275ErrorUtilities.VerifyThrow(LastChild != null, "Invalid structure");
295ErrorUtilities.VerifyThrowArgumentNull(child);
297ErrorUtilities.VerifyThrowArgument(child.Parent == this, "OM_NodeNotAlreadyParentedByThis");
354ErrorUtilities.VerifyThrowArgumentNull(element);
355ErrorUtilities.VerifyThrowArgument(GetType().IsEquivalentTo(element.GetType()), "CannotCopyFromElementOfThatType");
389ErrorUtilities.VerifyThrow(child.Parent == this, "Expected parent already set");
390ErrorUtilities.VerifyThrow(child.PreviousSibling == null && child.NextSibling == null, "Invalid structure");
391ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
441ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
458ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
474ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
494ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
600ErrorUtilities.VerifyThrow(Link == null, "Attempt to edit a document that is not backed by a local xml is disallowed.");
642ErrorUtilities.VerifyThrow(FirstChild == null && LastChild == null, "Expecting no children");
675ErrorUtilities.VerifyThrowInvalidOperation(Parent != null || ContainingProject == this, "OM_ParentNotParented");
676ErrorUtilities.VerifyThrowInvalidOperation(reference == null || reference.Parent == this, "OM_ReferenceDoesNotHaveThisParent");
677ErrorUtilities.VerifyThrowInvalidOperation(child.Parent == null, "OM_NodeAlreadyParented");
678ErrorUtilities.VerifyThrowInvalidOperation(child.ContainingProject == ContainingProject, "OM_MustBeSameProject");
683ErrorUtilities.VerifyThrow(child.NextSibling == null || child.NextSibling.PreviousSibling != this, "Invalid structure");
684ErrorUtilities.VerifyThrow(child.PreviousSibling == null || child.PreviousSibling.NextSibling != this, "Invalid structure");
698ErrorUtilities.VerifyThrowInvalidOperation(ancestor != element, "OM_SelfAncestor");
830public void Add(T item) => ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
832public void Clear() => ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
838ErrorUtilities.VerifyThrowArgumentNull(array);
857ErrorUtilities.ThrowInvalidOperation("OM_NotSupportedReadOnlyCollection");
867ErrorUtilities.VerifyThrowArgumentNull(array);
Construction\ProjectItemElement.cs (21)
68ErrorUtilities.VerifyThrowArgumentNull(parent);
105ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update);
127ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Remove.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.exclude, XMakeAttributes.remove);
128ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || Update.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.exclude, XMakeAttributes.update);
149ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Include.Length == 0 && Update.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update);
168ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || (Remove.Length == 0 && Include.Length == 0), "OM_OneOfAttributeButNotMore", ElementName, XMakeAttributes.include, XMakeAttributes.remove, XMakeAttributes.update);
189ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement || Parent.Parent is ProjectRootElement, "OM_NoMatchOnMetadataOutsideTargets");
191ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length != 0, "OM_MatchOnMetadataOnlyApplicableToRemoveItems", ElementName, XMakeAttributes.matchOnMetadata);
211ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || MatchOnMetadata.Length != 0, "OM_MatchOnMetadataOptionsOnlyApplicableToItemsWithMatchOnMetadata", ElementName, XMakeAttributes.matchOnMetadataOptions);
231ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoKeepMetadataOutsideTargets");
232ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || RemoveMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.removeMetadata, XMakeAttributes.keepMetadata);
252ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoRemoveMetadataOutsideTargets");
253ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(value) || KeepMetadata.Length == 0, "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.keepMetadata, XMakeAttributes.removeMetadata);
273ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is ProjectTargetElement, "OM_NoKeepDuplicatesOutsideTargets");
392ErrorUtilities.VerifyThrowArgumentLength(name);
393ErrorUtilities.VerifyThrowArgumentNull(unevaluatedValue);
425ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(itemType), "CannotModifyReservedItem", itemType);
442ErrorUtilities.VerifyThrowArgumentLength(newItemType);
444ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(newItemType), "CannotModifyReservedItem", newItemType);
475ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectTargetElement || (Include.Length > 0 || Update.Length > 0 || Remove.Length > 0), "OM_ItemsOutsideTargetMustHaveIncludeOrUpdateOrRemove");
476ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectRootElement || parent.Parent is ProjectTargetElement || parent.Parent is ProjectWhenElement || parent.Parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectUsingTaskElement.cs (8)
34ErrorUtilities.VerifyThrowArgumentNull(parent);
56ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.assemblyName);
57ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyName), "OM_EitherAttributeButNotBoth", ElementName, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName);
73ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.assemblyName);
74ErrorUtilities.VerifyThrowInvalidOperation(String.IsNullOrEmpty(AssemblyFile), "OM_EitherAttributeButNotBoth", XMakeElements.usingTask, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName);
88ErrorUtilities.VerifyThrowArgumentLength(value, XMakeAttributes.taskName);
234ErrorUtilities.VerifyThrowArgument(
268ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectRootElement, "OM_CannotAcceptParent");
Definition\Project.cs (64)
111ErrorUtilities.VerifyThrowArgumentNull(projectCollection);
112ErrorUtilities.VerifyThrowArgumentNull(link);
267ErrorUtilities.VerifyThrowArgumentNull(xml);
268ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
269ErrorUtilities.VerifyThrowArgumentNull(projectCollection);
361ErrorUtilities.VerifyThrowArgumentNull(xmlReader);
362ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
363ErrorUtilities.VerifyThrowArgumentNull(projectCollection);
457ErrorUtilities.VerifyThrowArgumentNull(projectFile);
458ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
459ErrorUtilities.VerifyThrowArgumentNull(projectCollection);
853ErrorUtilities.VerifyThrowArgumentNull(item);
863ErrorUtilities.VerifyThrowArgumentNull(item);
1080ErrorUtilities.VerifyThrowArgumentNull(metadatum);
1091ErrorUtilities.VerifyThrowArgumentNull(item);
1101ErrorUtilities.VerifyThrowArgumentNull(item);
1112ErrorUtilities.VerifyThrowArgumentNull(property);
1677ErrorUtilities.VerifyThrowInvalidOperation(!ThrowInsteadOfSplittingItemElement, "OM_CannotSplitItemElementWhenSplittingIsDisabled", itemElement.Location, $"{nameof(Project)}.{nameof(ThrowInsteadOfSplittingItemElement)}");
1797ErrorUtilities.VerifyThrow(!implementationInternal.IsZombified, "OM_ProjectIsNoLongerActive");
1808ErrorUtilities.VerifyThrowInternalNull(otherXml);
1809ErrorUtilities.VerifyThrowInvalidOperation(ReferenceEquals(Xml, otherXml), "OM_CannotModifyEvaluatedObjectInImportedFile", otherXml.Location.File);
1882ErrorUtilities.VerifyThrowArgumentNull(xml);
1883ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
1884ErrorUtilities.VerifyThrowArgumentNull(owner);
1906ErrorUtilities.VerifyThrowArgumentNull(xmlReader);
1907ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
1908ErrorUtilities.VerifyThrowArgumentNull(owner);
1941ErrorUtilities.VerifyThrowArgumentNull(projectFile);
1942ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
1943ErrorUtilities.VerifyThrowArgumentNull(owner);
2235ErrorUtilities.ThrowInvalidOperation("OM_NotEvaluatedBecauseShouldEvaluateForDesignTimeIsFalse", nameof(ItemsIgnoringCondition));
2277ErrorUtilities.VerifyThrowInvalidOperation((_loadSettings & ProjectLoadSettings.RecordDuplicateButNotCircularImports) != 0, "OM_MustSetRecordDuplicateInputs");
2456ErrorUtilities.ThrowInternalErrorUnreachable();
2840ErrorUtilities.ThrowInternalErrorUnreachable();
2927ErrorUtilities.VerifyThrowArgumentLength(name);
2928ErrorUtilities.VerifyThrowArgumentNull(unevaluatedValue);
2932ErrorUtilities.VerifyThrowInvalidOperation(property?.IsReservedProperty != true, "OM_ReservedName", name);
2933ErrorUtilities.VerifyThrowInvalidOperation(property?.IsGlobalProperty != true, "OM_GlobalProperty", name);
3055ErrorUtilities.VerifyThrowArgumentLength(itemType);
3056ErrorUtilities.VerifyThrowArgumentLength(unevaluatedInclude);
3155ErrorUtilities.VerifyThrowArgumentNull(property);
3156ErrorUtilities.VerifyThrowInvalidOperation(!property.IsReservedProperty, "OM_ReservedName", property.Name);
3157ErrorUtilities.VerifyThrowInvalidOperation(!property.IsGlobalProperty, "OM_GlobalProperty", property.Name);
3158ErrorUtilities.VerifyThrowArgument(property.Xml.Parent != null, "OM_IncorrectObjectAssociation", "ProjectProperty", "Project");
3182ErrorUtilities.VerifyThrowArgumentLength(name);
3217ErrorUtilities.VerifyThrowArgumentNull(item);
3218ErrorUtilities.VerifyThrowArgument(item.Project == Owner, "OM_IncorrectObjectAssociation", "ProjectItem", "Project");
3237ErrorUtilities.VerifyThrowArgumentNull(items);
3260ErrorUtilities.VerifyThrowArgumentNull(unexpandedValue);
3398ErrorUtilities.VerifyThrowInvalidOperation(!ThrowInsteadOfSplittingItemElement, "OM_CannotSplitItemElementWhenSplittingIsDisabled", itemElement.Location, $"{nameof(Project)}.{nameof(ThrowInsteadOfSplittingItemElement)}");
3557ErrorUtilities.VerifyThrow(_data.Expander.Metadata == null, "Should be null");
3584ErrorUtilities.VerifyThrowInternalNull(otherXml);
3585ErrorUtilities.VerifyThrowInvalidOperation(ReferenceEquals(Xml, otherXml), "OM_CannotModifyEvaluatedObjectInImportedFile", otherXml.Location.File);
3636ErrorUtilities.VerifyThrowArgumentNull(item);
3645ErrorUtilities.VerifyThrowArgument(item.Project == Owner, "OM_IncorrectObjectAssociation", "ProjectItem", "Project");
3735ErrorUtilities.VerifyThrow(LastEvaluationId != BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");
3756ErrorUtilities.VerifyThrow(!IsDirty, "Should not be dirty now");
3803ErrorUtilities.VerifyThrow(LastEvaluationId == BuildEventContext.InvalidEvaluationId, "This is the first evaluation therefore the last evaluation id is invalid");
3807ErrorUtilities.VerifyThrow(LastEvaluationId != BuildEventContext.InvalidEvaluationId, "Last evaluation ID must be valid after the first evaluation");
4388ErrorUtilities.VerifyThrowInternalNull(property);
4400ErrorUtilities.VerifyThrowInternalNull(itemDefinitionMetadatum);
4412ErrorUtilities.VerifyThrowInternalNull(item);
4532ErrorUtilities.ThrowInternalErrorUnreachable();
4626ErrorUtilities.VerifyThrowArgumentLength(name);
Definition\ProjectCollection.cs (19)
514ErrorUtilities.VerifyThrow(_defaultToolsVersion != null, "Should have a default");
521ErrorUtilities.VerifyThrowArgumentLength(value, nameof(DefaultToolsVersion));
529ErrorUtilities.ThrowInvalidOperation("UnrecognizedToolsVersion", value, toolsVersionList);
1013ErrorUtilities.VerifyThrowArgumentNull(toolset);
1029ErrorUtilities.VerifyThrowArgumentLength(toolsVersion);
1073ErrorUtilities.VerifyThrowArgumentLength(toolsVersion);
1160ErrorUtilities.VerifyThrowArgumentLength(fileName);
1351ErrorUtilities.VerifyThrowInvalidOperation(existed, "OM_ProjectWasNotLoaded");
1382ErrorUtilities.VerifyThrowArgumentNull(projectRootElement);
1393ErrorUtilities.ThrowInvalidOperation("OM_ProjectXmlCannotBeUnloadedDueToLoadedProjects", projectRootElement.FullPath, conflictingProject.FullPath);
1532ErrorUtilities.VerifyThrowArgumentNull(projectRootElement);
1580ErrorUtilities.VerifyThrowInvalidOperation(existed, "OM_ProjectWasNotLoaded");
1611ErrorUtilities.VerifyThrowInvalidOperation(ReferenceEquals(project.ProjectCollection, this), "OM_IncorrectObjectAssociation", "Project", "ProjectCollection");
1671ErrorUtilities.VerifyThrowArgumentNull(logger);
1752ErrorUtilities.ThrowInternalError("Throwing from logger shutdown", ex);
1945ErrorUtilities.VerifyThrowArgumentNull(originalLogger);
2145ErrorUtilities.VerifyThrow(_buildTimeEventSource == null, "Already registered for build-time.");
2175ErrorUtilities.VerifyThrow(_designTimeEventSource != null, "Already unregistered for design-time.");
2550ErrorUtilities.ThrowInvalidOperation("OM_MatchingProjectAlreadyInCollection", existing.FullPath);
Definition\ProjectItem.cs (19)
130ErrorUtilities.VerifyThrowInternalNull(project);
131ErrorUtilities.VerifyThrowArgumentNull(xml);
134ErrorUtilities.VerifyThrowArgumentNull(evaluatedIncludeEscaped);
135ErrorUtilities.VerifyThrowArgumentNull(evaluatedIncludeBeforeWildcardExpansionEscaped);
415ErrorUtilities.VerifyThrowArgumentLength(name);
481ErrorUtilities.VerifyThrowArgumentLength(name);
586ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name);
587ErrorUtilities.VerifyThrowInvalidOperation(!XMakeElements.ReservedItemNames.Contains(name), "CannotModifyReservedItemMetadata", name);
588ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
643ErrorUtilities.VerifyThrowArgumentLength(name);
644ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name);
646ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
653ErrorUtilities.VerifyThrowInvalidOperation(itemDefinitionMetadata == null, "OM_CannotRemoveMetadataOriginatingFromItemDefinition", name);
696ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
790ErrorUtilities.VerifyThrowArgumentLength(newItemType, "ItemType");
792ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
945set { ErrorUtilities.ThrowInternalError("Cannot change the item type on ProjectItem.ProjectItemFactory"); }
1020ErrorUtilities.VerifyThrowInternalNull(_xml, "xml");
1044ErrorUtilities.VerifyThrowInternalNull(_xml, "xml");
Definition\ProjectProperty.cs (14)
43ErrorUtilities.VerifyThrowArgumentNull(project);
52ErrorUtilities.VerifyThrowArgumentNull(project);
53ErrorUtilities.VerifyThrowArgumentNull(evaluatedValueEscaped);
362ErrorUtilities.VerifyThrowArgumentNull(xml);
363ErrorUtilities.VerifyThrowInvalidOperation(!ProjectHasMatchingGlobalProperty(project, xml.Name), "OM_GlobalProperty", xml.Name);
405ErrorUtilities.VerifyThrowInvalidOperation(_xml.Parent?.Parent != null, "OM_ObjectIsNoLongerActive");
507ErrorUtilities.VerifyThrowArgumentNull(predecessor);
547ErrorUtilities.VerifyThrowArgumentLength(name);
548ErrorUtilities.VerifyThrowInvalidOperation(isGlobalProperty || !ProjectHasMatchingGlobalProperty(project, name), "OM_GlobalProperty", name);
549ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(name), "OM_ReservedName", name);
550ErrorUtilities.VerifyThrowArgument(mayBeReserved || !ReservedPropertyNames.IsReservedProperty(name), "OM_ReservedName", name);
591ErrorUtilities.VerifyThrowInvalidOperation(!IsReservedProperty, "OM_ReservedName", _name);
592ErrorUtilities.VerifyThrowInvalidOperation(!IsGlobalProperty, "OM_GlobalProperty", _name);
606ErrorUtilities.ThrowInternalErrorUnreachable();
Evaluation\Expander.cs (18)
239ErrorUtilities.VerifyThrowObjectDisposed(!_disposed, nameof(SpanBasedConcatenator));
496ErrorUtilities.VerifyThrowInternalNull(elementLocation);
517ErrorUtilities.VerifyThrowInternalNull(elementLocation);
531ErrorUtilities.VerifyThrow((options & ExpanderOptions.BreakOnNotEmpty) == 0, "not supported");
565ErrorUtilities.VerifyThrowInternalNull(elementLocation);
639ErrorUtilities.VerifyThrowInternalNull(elementLocation);
939ErrorUtilities.VerifyThrow(metadata != null, "Cannot expand metadata without providing metadata");
1069ErrorUtilities.VerifyThrow(options != ExpanderOptions.Invalid, "Must be expanding metadata of some kind");
1077ErrorUtilities.VerifyThrow(itemMetadataMatch.Success, "Need a valid item metadata.");
1197ErrorUtilities.VerifyThrow(properties != null, "Cannot expand properties without providing properties");
1880ErrorUtilities.VerifyThrow(matches.Count == 1, "Expected just one item vector");
1891ErrorUtilities.VerifyThrow(items != null, "Cannot expand items without providing items");
2004ErrorUtilities.VerifyThrow(evaluatedItems != null, "Cannot expand items without providing items");
2087ErrorUtilities.VerifyThrow(items != null, "Cannot expand items without providing items");
3693ErrorUtilities.VerifyThrow(_loggingContext != null, $"The logging context is missed. {nameof(IntrinsicFunctions.RegisterBuildCheck)} can not be invoked.");
3726ErrorUtilities.ThrowArgument("CouldNotDifferentiateBetweenCompatibleMethods", _methodMethodName, args.Length);
5045ErrorUtilities.VerifyThrow(cachedTypeInformation.Item1 != null || cachedTypeInformation.Item2 != null, "Function type information needs either string or type represented.");
5063ErrorUtilities.VerifyThrowInternalNull(receiverType, $"Type information for {typeName} was present in the allowlist cache as {assemblyQualifiedTypeName} but the type could not be loaded.");
Evaluation\IntrinsicFunctions.cs (3)
477ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", runtime, "Runtime", XMakeAttributes.MSBuildRuntimeValues.clr2, XMakeAttributes.MSBuildRuntimeValues.clr4, XMakeAttributes.MSBuildRuntimeValues.currentRuntime, XMakeAttributes.MSBuildRuntimeValues.any);
482ErrorUtilities.ThrowArgument("InvalidTaskHostFactoryParameter", architecture, "Architecture", XMakeAttributes.MSBuildArchitectureValues.x86, XMakeAttributes.MSBuildArchitectureValues.x64, XMakeAttributes.MSBuildArchitectureValues.currentArchitecture, XMakeAttributes.MSBuildArchitectureValues.any);
777ErrorUtilities.ThrowArgument(keyName);
FrameworkLocationHelper.cs (10)
635ErrorUtilities.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
645ErrorUtilities.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
670ErrorUtilities.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
680ErrorUtilities.VerifyThrowArgument(visualStudioSpec.SupportedDotNetFrameworkVersions.Contains(dotNetFrameworkVersion), "FrameworkLocationHelper.UnsupportedFrameworkVersion", dotNetFrameworkVersion);
975ErrorUtilities.VerifyThrowArgumentNull(targetFrameworkRootPath);
976ErrorUtilities.VerifyThrowArgumentNull(frameworkName);
990ErrorUtilities.ThrowInvalidOperation("FrameworkLocationHelper.CouldNotGenerateReferenceAssemblyDirectory", targetFrameworkRootPath, frameworkName.ToString(), e.Message);
1004ErrorUtilities.VerifyThrowArgumentOutOfRange(numberOfLevelsToRemove > 0, nameof(numberOfLevelsToRemove));
1119ErrorUtilities.VerifyThrowArgument(VisualStudioSpecDict.Value.TryGetValue(version, out VisualStudioSpec spec), "FrameworkLocationHelper.UnsupportedVisualStudioVersion", version);
1125ErrorUtilities.VerifyThrowArgument(DotNetFrameworkSpecDict.Value.TryGetValue(version, out DotNetFrameworkSpec spec), "FrameworkLocationHelper.UnsupportedFrameworkVersion", version);
Instance\ProjectInstance.cs (41)
297ErrorUtilities.VerifyThrowArgumentLength(projectFile);
298ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
371ErrorUtilities.VerifyThrowInternalNull(project);
428ErrorUtilities.VerifyThrowInternalNull(linkedProject);
615ErrorUtilities.VerifyThrowArgumentLength(projectFile);
616ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
617ErrorUtilities.VerifyThrowArgumentNull(buildParameters);
631ErrorUtilities.VerifyThrowArgumentNull(xml);
632ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
633ErrorUtilities.VerifyThrowArgumentNull(buildParameters);
643ErrorUtilities.VerifyThrowInternalNull(data);
644ErrorUtilities.VerifyThrowInternalLength(directory, nameof(directory));
645ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(fullPath, nameof(fullPath));
698ErrorUtilities.VerifyThrow(filter == null || isImmutable,
1458ErrorUtilities.ThrowInternalErrorUnreachable();
1612ErrorUtilities.VerifyThrowArgumentNull(item);
1622ErrorUtilities.VerifyThrowArgumentNull(item);
1632ErrorUtilities.VerifyThrowArgumentNull(metadatum);
1643ErrorUtilities.VerifyThrowArgumentNull(item);
1653ErrorUtilities.VerifyThrowArgumentNull(item);
1664ErrorUtilities.VerifyThrowArgumentNull(property);
1718ErrorUtilities.ThrowInternalErrorUnreachable();
1745ErrorUtilities.ThrowInternalErrorUnreachable();
1759ErrorUtilities.ThrowInternalErrorUnreachable();
1773ErrorUtilities.ThrowInternalErrorUnreachable();
2346ErrorUtilities.VerifyThrow(ProjectRootElementCache == null, $"{nameof(ProjectRootElementCache)} is already set. Cannot set again");
2347ErrorUtilities.VerifyThrow(_hostServices == null, $"{nameof(HostServices)} is already set. Cannot set again");
2348ErrorUtilities.VerifyThrow(TaskRegistry != null, $"{nameof(TaskRegistry)} Cannot be null after {nameof(ProjectInstance)} object creation.");
2540ErrorUtilities.VerifyThrowArgumentLength(projectFile);
2541ErrorUtilities.VerifyThrowArgumentNull(globalPropertiesInstances);
2542ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(toolsVersion, nameof(toolsVersion));
2543ErrorUtilities.VerifyThrowArgumentNull(buildParameters);
2544ErrorUtilities.VerifyThrow(FileUtilities.IsSolutionFilename(projectFile), "Project file {0} is not a solution.", projectFile);
2674ErrorUtilities.ThrowInvalidOperation("OM_ProjectInstanceImmutable");
2811ErrorUtilities.VerifyThrowInternalLength(targetName, nameof(targetName));
2812ErrorUtilities.VerifyThrow(!_actualTargets.ContainsKey(targetName), "Target {0} already exists.", targetName);
3084ErrorUtilities.VerifyThrowArgumentNull(xml);
3085ErrorUtilities.VerifyThrowArgumentLengthIfNotNull(explicitToolsVersion, "toolsVersion");
3086ErrorUtilities.VerifyThrowArgumentNull(buildParameters);
3167ErrorUtilities.VerifyThrow(EvaluationId == BuildEventContext.InvalidEvaluationId, "Evaluation ID is invalid prior to evaluation");
3189ErrorUtilities.VerifyThrow(EvaluationId != BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");
Instance\ProjectItemInstance.cs (18)
204ErrorUtilities.VerifyThrowArgumentLength(value, "EvaluatedInclude");
708ErrorUtilities.VerifyThrowArgumentNull(projectToUse, "project");
709ErrorUtilities.VerifyThrowArgumentLength(itemTypeToUse, "itemType");
711ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(itemTypeToUse), "OM_ReservedName", itemTypeToUse);
836ErrorUtilities.VerifyThrowArgumentLength(includeEscaped);
837ErrorUtilities.VerifyThrowArgumentLength(includeBeforeWildcardExpansionEscaped);
906ErrorUtilities.VerifyThrowArgumentNull(value, "ItemSpec");
1023ErrorUtilities.VerifyThrowArgumentLength(value, "IncludeEscaped");
1290ErrorUtilities.ThrowInternalErrorUnreachable();
1299ErrorUtilities.ThrowInternalErrorUnreachable();
1320ErrorUtilities.VerifyThrowArgumentLength(metadataName);
1414ErrorUtilities.VerifyThrowArgumentNull(destinationItem);
1988ErrorUtilities.VerifyThrowInternalLength(itemType, nameof(itemType));
2018ErrorUtilities.VerifyThrowInternalLength(ItemType, "ItemType");
2051ErrorUtilities.VerifyThrowInternalLength(ItemType, "ItemType");
2077ErrorUtilities.VerifyThrowInternalLength(ItemType, "ItemType");
2078ErrorUtilities.VerifyThrowInternalNull(source);
2227ErrorUtilities.ThrowInternalErrorUnreachable();
InterningBinaryReader.cs (3)
14using ErrorUtilities = Microsoft.Build.Shared.ErrorUtilities;
126ErrorUtilities.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);
141ErrorUtilities.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);
Logging\ParallelLogger\ParallelConsoleLogger.cs (15)
514ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
515ErrorUtilities.VerifyThrowArgumentNull(e.ParentProjectBuildEventContext, "ParentProjectBuildEventContext");
654ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
658ErrorUtilities.VerifyThrow(startedEvent != null, "Project finished event for {0} received without matching start event", e.ProjectFile);
844ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
865ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
882ErrorUtilities.VerifyThrow(startedEvent != null, "Started event should not be null in the finished event handler");
937ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
978ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
1028ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
1074ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
1132ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
1447ErrorUtilities.VerifyThrow(startedEvent != null, "Project Started should not be null in deferred target started");
1578ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext");
1742ErrorUtilities.VerifyThrow(_startedEvent != null, "Cannot have finished counter without started counter. ");
Modifiers.cs (8)
385ErrorUtilities.VerifyThrow(itemSpec != null, "Need item-spec to modify.");
386ErrorUtilities.VerifyThrow(modifier != null, "Need modifier to apply to item-spec.");
417ErrorUtilities.VerifyThrow(FileUtilitiesRegex.StartsWithUncPattern(modifiedItemSpec),
478ErrorUtilities.VerifyThrow((modifiedItemSpec.Length > length) && IsSlash(modifiedItemSpec[length]),
486ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(modifiedItemSpec) && IsSlash(modifiedItemSpec[0]),
588ErrorUtilities.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier);
597ErrorUtilities.ThrowInternalError("\"{0}\" is not a valid item-spec modifier.", modifier);
602ErrorUtilities.ThrowInvalidOperation("Shared.InvalidFilespecForTransform", modifier, itemSpec, e.Message);
TaskLoggingHelper.cs (37)
52ErrorUtilities.VerifyThrowArgumentNull(taskInstance);
62ErrorUtilities.VerifyThrowArgumentNull(buildEngine);
63ErrorUtilities.VerifyThrowArgumentLength(taskName);
181ErrorUtilities.VerifyThrowArgumentNull(message);
205ErrorUtilities.VerifyThrowArgumentNull(resourceName);
206ErrorUtilities.VerifyThrowInvalidOperation(TaskResources != null, "Shared.TaskResourcesNotRegistered", TaskName);
210ErrorUtilities.VerifyThrowArgument(resourceString != null, "Shared.TaskResourceNotFound", resourceName, TaskName);
225ErrorUtilities.VerifyThrowArgumentNull(unformatted);
294ErrorUtilities.VerifyThrowArgumentNull(message);
321ErrorUtilities.ThrowInvalidOperation("LoggingBeforeTaskInitialization", e.Message);
330ErrorUtilities.VerifyThrow(errorCode == null, "This message contains an error code (" + errorCode + "), yet it was logged as a regular message: " + message);
364ErrorUtilities.VerifyThrowArgumentNull(message);
374ErrorUtilities.VerifyThrowInvalidOperation(BuildEngine != null, "LoggingBeforeTaskInitialization", message);
426ErrorUtilities.VerifyThrowArgumentNull(message);
431ErrorUtilities.VerifyThrowInvalidOperation(BuildEngine != null, "LoggingBeforeTaskInitialization", message);
490ErrorUtilities.VerifyThrowArgumentNull(messageResourceName);
503ErrorUtilities.VerifyThrow(errorCode == null, errorCode, FormatResourceString(messageResourceName, messageArgs));
514ErrorUtilities.VerifyThrowArgumentNull(filePath);
515ErrorUtilities.VerifyThrowArgumentNull(content);
605ErrorUtilities.VerifyThrowArgumentNull(commandLine);
619ErrorUtilities.ThrowInvalidOperation("LoggingBeforeTaskInitialization", e.Message);
701ErrorUtilities.VerifyThrowArgumentNull(message);
706ErrorUtilities.VerifyThrowInvalidOperation(BuildEngine != null, "LoggingBeforeTaskInitialization", message);
778ErrorUtilities.VerifyThrowArgumentNull(messageResourceName);
795ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(messageCode), "Called LogErrorFromResources instead of LogErrorWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
861ErrorUtilities.VerifyThrowArgumentNull(messageResourceName);
929ErrorUtilities.VerifyThrowArgumentNull(exception);
1052ErrorUtilities.VerifyThrowArgumentNull(message);
1057ErrorUtilities.VerifyThrowInvalidOperation(BuildEngine != null, "LoggingBeforeTaskInitialization", message);
1148ErrorUtilities.VerifyThrowArgumentNull(messageResourceName);
1163ErrorUtilities.VerifyThrow(string.IsNullOrEmpty(messageCode), "Called LogWarningFromResources instead of LogWarningWithCodeFromResources, but message '" + throwAwayMessageBody + "' does have an error code '" + messageCode + "'");
1229ErrorUtilities.VerifyThrowArgumentNull(messageResourceName);
1281ErrorUtilities.VerifyThrowArgumentNull(exception);
1323ErrorUtilities.VerifyThrowArgumentNull(fileName);
1350ErrorUtilities.VerifyThrowArgumentNull(stream);
1378ErrorUtilities.VerifyThrowArgumentNull(lineOfText);
1436ErrorUtilities.ThrowInternalError("Impossible canonical part.");