BackEnd\BuildManager\BuildManager.cs (8)
1244entries = _multiThreadedStrictModeScope.VerifyUnresolvedPathWrites(ElementLocation.Empty, out recovered);
1266BuildEventContext.Invalid, DiagnosticSubcategory.None, warningCode, helpKeyword, ElementLocation.Empty, message);
2416ElementLocation.Create(submission.BuildRequestData.ProjectFullPath));
3052ElementLocation.Empty, // no project file
3067ElementLocation.Empty, // no project file
3219ElementLocation.Empty,
3677location: ElementLocation.Empty,
3865ElementLocation.Empty,
BackEnd\Components\SdkResolution\OutOfProcNodeSdkResolverService.cs (2)
67public override SdkResult ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio, bool failOnUnresolvedSdk)
123private SdkResult RequestSdkPathFromMainNode(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio)
BackEnd\Components\SdkResolution\SdkResolverRequest.cs (5)
18private ElementLocation _elementLocation;
33private SdkResolverRequest(int submissionId, string name, string version, string minimumVersion, BuildEventContext buildEventContext, ElementLocation elementLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio)
49public ElementLocation ElementLocation => _elementLocation;
71public static SdkResolverRequest Create(int submissionId, SdkReference sdkReference, BuildEventContext buildEventContext, ElementLocation elementLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio)
84translator.Translate(ref _elementLocation, ElementLocation.FactoryForDeserialization);
BackEnd\Components\SdkResolution\SdkResolverService.cs (7)
112public virtual SdkResult ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio, bool failOnUnresolvedSdk)
168private SdkResult ResolveSdkUsingResolversWithPatternsFirst(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio, bool failOnUnresolvedSdk)
270private List<SdkResolver> GetResolvers(IReadOnlyList<SdkResolverManifest> resolversManifests, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, SdkReference sdk)
316ElementLocation sdkReferenceLocation,
418internal virtual IReadOnlyList<SdkResolverManifest> GetResolverManifests(ElementLocation location) => _sdkResolverLoader.GetResolversManifests(location);
454private static void LogWarnings(LoggingContext loggingContext, ElementLocation location, IEnumerable<string> warnings)
492private void RegisterResolversManifests(ElementLocation location)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (13)
126private ElementLocation _taskLocation;
281ElementLocation taskLocation,
559public bool SetTaskParameters(IDictionary<string, (string, ElementLocation)> parameters)
581foreach (KeyValuePair<string, (string, ElementLocation)> parameter in parameters)
640public bool GatherTaskOutputs(string parameterName, ElementLocation parameterLocation, bool outputTargetIsItem, string outputTargetName)
1004private bool SetParameterArray(TaskPropertyInfo parameter, Type parameterType, IList<TaskItem> taskItems, ElementLocation parameterLocation)
1385ElementLocation parameterLocation,
1634ElementLocation parameterLocation,
1774ElementLocation parameterLocation,
1820ElementLocation parameterLocation)
1899private void GatherTaskItemOutputs(bool outputTargetIsItem, string outputTargetName, ITaskItem[] outputs, ElementLocation parameterLocation, TaskPropertyInfo parameter)
1980private bool GatherProjectItemInstanceTaskItemOutputs(string outputTargetName, ITaskItem[] outputs, ElementLocation parameterLocation)
2075private void GatherArrayStringAndValueOutputs(bool outputTargetIsItem, string outputTargetName, string[] outputs, ElementLocation parameterLocation, TaskPropertyInfo parameter)
Construction\ProjectTaskElement.cs (12)
36private CopyOnWriteDictionary<(string, ElementLocation)> _parameters;
151foreach (KeyValuePair<string, (string, ElementLocation)> entry in _parameters)
166public IEnumerable<KeyValuePair<string, ElementLocation>> ParameterLocations
178var parameterLocations = new List<KeyValuePair<string, ElementLocation>>();
180foreach (KeyValuePair<string, (string, ElementLocation)> entry in _parameters)
182parameterLocations.Add(new KeyValuePair<string, ElementLocation>(entry.Key, entry.Value.Item2));
194public ElementLocation ContinueOnErrorLocation => GetAttributeLocation(XMakeAttributes.continueOnError);
200public ElementLocation MSBuildRuntimeLocation => GetAttributeLocation(XMakeAttributes.msbuildRuntime);
206public ElementLocation MSBuildArchitectureLocation => GetAttributeLocation(XMakeAttributes.msbuildArchitecture);
211internal CopyOnWriteDictionary<(string, ElementLocation)> ParametersForEvaluation
303if (_parameters.TryGetValue(name, out (string, ElementLocation) parameter))
444_parameters = new CopyOnWriteDictionary<(string, ElementLocation)>(StringComparer.OrdinalIgnoreCase);
Construction\Solution\SolutionFile.cs (20)
314ElementLocation.Create(FullPath),
327var errorLocation = ElementLocation.Create(FullPath, solutionEx.Line ?? 0, solutionEx.Column ?? 0);
336ElementLocation.Create(FullPath),
581ElementLocation.Create(solutionFile),
593ElementLocation.Create(solutionFile),
624ElementLocation.Create(solutionFile),
638ElementLocation.Create(_solutionFile),
656ElementLocation.Create(solutionFilterFile),
678ElementLocation.Create(solutionFilterFile),
700private ElementLocation GetCurrentLocation()
701=> ElementLocation.Create(FullPath, _currentLineNumber);
750ProjectErrorUtilities.ThrowInvalidProject(ElementLocation.Create(_solutionFile), "InvalidProjectFile", e.Message);
898ElementLocation.Create(FullPath),
919ElementLocation.Create(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))),
964ElementLocation.Create(FullPath),
1139ElementLocation.Create(FullPath),
1580ProjectErrorUtilities.ThrowInvalidProject(ElementLocation.Create(FullPath), "ProjectUpgradeNeededToVcxProj", proj.RelativePath);
1720ElementLocation.Create(projectPath, lineNumber, 0),
1822ElementLocation.Create(FullPath),
Definition\Project.cs (12)
827public ElementLocation ProjectFileLocation => Xml.ProjectFileLocation;
1771internal string ExpandPropertyValueBestEffortLeaveEscaped(string unevaluatedValue, ElementLocation propertyLocation)
1801internal string ExpandMetadataValueBestEffortLeaveEscaped(IMetadataTable metadataTable, string unevaluatedValue, ElementLocation metadataLocation)
2493public ElementLocation ProjectFileLocation => Xml.ProjectFileLocation;
3217ElementLocation.Create(FullPath),
3386public string ExpandPropertyValueBestEffortLeaveEscaped(string unevaluatedValue, ElementLocation propertyLocation)
3440public string ExpandMetadataValueBestEffortLeaveEscaped(IMetadataTable metadataTable, string unevaluatedValue, ElementLocation metadataLocation)
3856string ExpandPropertyValueBestEffortLeaveEscaped(string unevaluatedValue, ElementLocation propertyLocation);
3860string ExpandMetadataValueBestEffortLeaveEscaped(IMetadataTable metadataTable, string unevaluatedValue, ElementLocation metadataLocation);
3881public string ExpandPropertyValueBestEffortLeaveEscaped(string unevaluatedValue, ElementLocation propertyLocation) { throw new NotImplementedException(); }
3885public string ExpandMetadataValueBestEffortLeaveEscaped(IMetadataTable metadataTable, string unevaluatedValue, ElementLocation metadataLocation) { throw new NotImplementedException(); }
4179ElementLocation toolsVersionLocation = Project.Xml.ProjectFileLocation;
Definition\Toolset.cs (7)
599ElementLocation.Empty,
610ElementLocation.Empty,
867ElementLocation.Empty,
910loggingContext.LogWarning(DiagnosticSubcategory.None, ElementLocation.Empty, "OverrideTasksFileFailure", rootedPathMessage);
917loggingContext.LogWarning(DiagnosticSubcategory.None, ElementLocation.Empty, "OverrideTasksFileFailure", rootedPathMessage);
957ProjectErrorUtilities.ThrowInvalidProject(ElementLocation.CreateFrom(currentTasksFile, e),
962loggingContext.LogError(ElementLocation.Create(currentTasksFile),
ElementLocation\ElementLocation.cs (18)
34public static ElementLocation Empty { get; } = new FileOnly(string.Empty);
43public static ElementLocation EmptyLocation => Empty;
79/// with potential user-derived <see cref="ElementLocation"/> instances.
89/// <see langword="true"/> when <paramref name="obj"/> is an <see cref="ElementLocation"/> with the same
97|| (obj is ElementLocation other && Equals(other));
100/// Determines whether an <see cref="ElementLocation"/> represents the same file, line, and column as this location.
102/// <param name="other">The <see cref="ElementLocation"/> to compare with this location.</param>
109private bool Equals(ElementLocation other)
150/// A factory is required because <see cref="ElementLocation"/> is abstract and uses specialized
153internal static ElementLocation FactoryForDeserialization(ITranslator translator)
176internal static ElementLocation Create(string? file)
189internal static ElementLocation Create(string? file, int line)
220public static ElementLocation Create(string? file, int line, int column)
246internal static ElementLocation CreateFrom(XmlException exception)
266internal static ElementLocation CreateFrom(string? file, XmlException exception)
319ElementLocation { Line: 0, Column: 0 } other => StringComparer.OrdinalIgnoreCase.Equals(File, other.File),
368ElementLocation other => Equals(other),
418ElementLocation other => Equals(other),
Evaluation\Evaluator.cs (5)
416ElementLocation.Create(root.ProjectFileLocation.File),
1274_evaluationLoggingContext.LogWarning(DiagnosticSubcategory.None, ElementLocation.Empty, "ChangeWave_InvalidFormat", Traits.Instance.MSBuildDisableFeaturesFromVersion, $"[{string.Join(", ", ChangeWaves.AllWaves.Select(x => x.ToString()))}]");
1277_evaluationLoggingContext.LogWarning(DiagnosticSubcategory.None, ElementLocation.Empty, "ChangeWave_OutOfRotation", ChangeWaves.DisabledWave, Traits.Instance.MSBuildDisableFeaturesFromVersion, $"[{string.Join(", ", ChangeWaves.AllWaves.Select(x => x.ToString()))}]");
2174ElementLocation importLocationInProject = importElement.Location;
2919private void VerifyVSDistributionPath(string path, ElementLocation importLocationInProject)
Instance\ProjectInstance.cs (19)
160private ElementLocation _projectFileLocation;
391_projectFileLocation = ElementLocation.Create(projectPath);
444_projectFileLocation = ElementLocation.Create(projectPath);
576_projectFileLocation = ElementLocation.Create(projectFile);
691_projectFileLocation = ElementLocation.Create(fullPath);
1622public ElementLocation ProjectFileLocation
2055new PropertyReadInfo(name, ElementLocation.Empty, false, PropertyReadContext.Other));
2076_loggingContext?.ProcessPropertyWrite(new PropertyWriteInfo(name, false, ElementLocation.Empty));
2576translator.Translate(ref _projectFileLocation, ElementLocation.FactoryForDeserialization);
2996String.IsNullOrEmpty(condition) ? null : ElementLocation.Empty,
2997String.IsNullOrEmpty(inputs) ? null : ElementLocation.Empty,
2998String.IsNullOrEmpty(outputs) ? null : ElementLocation.Empty,
2999String.IsNullOrEmpty(returns) ? null : ElementLocation.Empty,
3000String.IsNullOrEmpty(keepDuplicateOutputs) ? null : ElementLocation.Empty,
3001String.IsNullOrEmpty(dependsOnTargets) ? null : ElementLocation.Empty,
3002String.IsNullOrEmpty(beforeTargets) ? null : ElementLocation.Empty,
3003String.IsNullOrEmpty(afterTargets) ? null : ElementLocation.Empty,
3263_projectFileLocation = xml.ProjectFileLocation ?? ElementLocation.Empty;
3281ElementLocation toolsVersionLocation = xml.Location;
Instance\ProjectItemGroupTaskItemInstance.cs (40)
74private ElementLocation _location;
79private ElementLocation _includeLocation;
84private ElementLocation _excludeLocation;
89private ElementLocation _removeLocation;
94private ElementLocation _matchOnMetadataLocation;
99private ElementLocation _matchOnMetadataOptionsLocation;
104private ElementLocation _keepMetadataLocation;
109private ElementLocation _removeMetadataLocation;
114private ElementLocation _keepDuplicatesLocation;
119private ElementLocation _conditionLocation;
149ElementLocation location,
150ElementLocation includeLocation,
151ElementLocation excludeLocation,
152ElementLocation removeLocation,
153ElementLocation matchOnMetadataLocation,
154ElementLocation matchOnMetadataOptionsLocation,
155ElementLocation keepMetadataLocation,
156ElementLocation removeMetadataLocation,
157ElementLocation keepDuplicatesLocation,
158ElementLocation conditionLocation,
335public ElementLocation Location
345public ElementLocation IncludeLocation
355public ElementLocation ExcludeLocation
365public ElementLocation RemoveLocation
375public ElementLocation MatchOnMetadataLocation
385public ElementLocation MatchOnMetadataOptionsLocation
395public ElementLocation KeepMetadataLocation
405public ElementLocation RemoveMetadataLocation
415public ElementLocation KeepDuplicatesLocation
425public ElementLocation ConditionLocation
452translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
453translator.Translate(ref _includeLocation, ElementLocation.FactoryForDeserialization);
454translator.Translate(ref _excludeLocation, ElementLocation.FactoryForDeserialization);
455translator.Translate(ref _removeLocation, ElementLocation.FactoryForDeserialization);
456translator.Translate(ref _keepMetadataLocation, ElementLocation.FactoryForDeserialization);
457translator.Translate(ref _removeMetadataLocation, ElementLocation.FactoryForDeserialization);
458translator.Translate(ref _keepDuplicatesLocation, ElementLocation.FactoryForDeserialization);
459translator.Translate(ref _matchOnMetadataLocation, ElementLocation.FactoryForDeserialization);
460translator.Translate(ref _matchOnMetadataOptionsLocation, ElementLocation.FactoryForDeserialization);
461translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
Instance\ProjectPropertyInstance.cs (3)
237internal static ProjectPropertyInstance Create(string name, string escapedValue, ElementLocation location)
246internal static ProjectPropertyInstance Create(string name, string escapedValue, ElementLocation location, bool isImmutable)
323private static ProjectPropertyInstance Create(string name, string escapedValue, bool mayBeReserved, ElementLocation location, bool isImmutable, bool isEnvironmentProperty = false, LoggingContext loggingContext = null)
Instance\ProjectTargetInstance.cs (36)
88private ElementLocation _location;
93private ElementLocation _conditionLocation;
98private ElementLocation _inputsLocation;
103private ElementLocation _outputsLocation;
108private ElementLocation _returnsLocation;
113private ElementLocation _keepDuplicateOutputsLocation;
118private ElementLocation _dependsOnTargetsLocation;
123private ElementLocation _beforeTargetsLocation;
128private ElementLocation _afterTargetsLocation;
151ElementLocation location,
152ElementLocation conditionLocation,
153ElementLocation inputsLocation,
154ElementLocation outputsLocation,
155ElementLocation returnsLocation,
156ElementLocation keepDuplicateOutputsLocation,
157ElementLocation dependsOnTargetsLocation,
158ElementLocation beforeTargetsLocation,
159ElementLocation afterTargetsLocation,
351public ElementLocation Location
361public ElementLocation ConditionLocation
371public ElementLocation InputsLocation
381public ElementLocation OutputsLocation
391public ElementLocation ReturnsLocation
401public ElementLocation KeepDuplicateOutputsLocation
411public ElementLocation DependsOnTargetsLocation
421public ElementLocation BeforeTargetsLocation
431public ElementLocation AfterTargetsLocation
560translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
561translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
562translator.Translate(ref _inputsLocation, ElementLocation.FactoryForDeserialization);
563translator.Translate(ref _outputsLocation, ElementLocation.FactoryForDeserialization);
564translator.Translate(ref _returnsLocation, ElementLocation.FactoryForDeserialization);
565translator.Translate(ref _keepDuplicateOutputsLocation, ElementLocation.FactoryForDeserialization);
566translator.Translate(ref _dependsOnTargetsLocation, ElementLocation.FactoryForDeserialization);
567translator.Translate(ref _beforeTargetsLocation, ElementLocation.FactoryForDeserialization);
568translator.Translate(ref _afterTargetsLocation, ElementLocation.FactoryForDeserialization);
Instance\ProjectTaskInstance.cs (49)
57private CopyOnWriteDictionary<(string, ElementLocation)> _parameters;
69private ElementLocation _location;
74private ElementLocation _conditionLocation;
79private ElementLocation _continueOnErrorLocation;
84private ElementLocation _msbuildRuntimeLocation;
89private ElementLocation _msbuildArchitectureLocation;
129ElementLocation location,
139new CopyOnWriteDictionary<(string, ElementLocation)>(StringComparer.OrdinalIgnoreCase),
142condition == string.Empty ? null : ElementLocation.Empty,
143continueOnError == string.Empty ? null : ElementLocation.Empty,
144msbuildRuntime == string.Empty ? null : ElementLocation.Empty,
145msbuildArchitecture == string.Empty ? null : ElementLocation.Empty)
155CopyOnWriteDictionary<(string, ElementLocation)> parameters,
157ElementLocation location,
158ElementLocation conditionLocation,
159ElementLocation continueOnErrorElementLocation,
160ElementLocation msbuildRuntimeLocation,
161ElementLocation msbuildArchitectureLocation)
238foreach (KeyValuePair<string, (string, ElementLocation)> parameter in _parameters)
247internal IDictionary<string, (string, ElementLocation)> TestGetParameters => _parameters;
261public ElementLocation ContinueOnErrorLocation
269public ElementLocation MSBuildRuntimeLocation
277public ElementLocation MSBuildArchitectureLocation
285public override ElementLocation Location
293public override ElementLocation ConditionLocation
301internal CopyOnWriteDictionary<(string, ElementLocation)> ParametersForBuild
328_parameters[parameterName] = (unevaluatedValue, ElementLocation.Empty);
341_outputs.Add(new ProjectTaskOutputItemInstance(itemName, taskOutputParameterName, condition ?? String.Empty, ElementLocation.Empty, ElementLocation.Empty, ElementLocation.Empty, condition == null ? null : ElementLocation.Empty));
354_outputs.Add(new ProjectTaskOutputPropertyInstance(propertyName, taskOutputParameterName, condition ?? String.Empty, ElementLocation.Empty, ElementLocation.Empty, ElementLocation.Empty, condition == null ? null : ElementLocation.Empty));
371translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
372translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
373translator.Translate(ref _continueOnErrorLocation, ElementLocation.FactoryForDeserialization);
374translator.Translate(ref _msbuildRuntimeLocation, ElementLocation.FactoryForDeserialization);
375translator.Translate(ref _msbuildArchitectureLocation, ElementLocation.FactoryForDeserialization);
377IDictionary<string, (string, ElementLocation)> localParameters = _parameters;
382count => new CopyOnWriteDictionary<(string, ElementLocation)>());
386_parameters = (CopyOnWriteDictionary<(string, ElementLocation)>)localParameters;
395private static void ParametersValueTranslator(ITranslator translator, ref (string, ElementLocation) value)
400var item2 = value.Item2;
403translator.Translate(ref item2, ElementLocation.FactoryForDeserialization);
408var item2 = default(ElementLocation);
411translator.Translate(ref item2, ElementLocation.FactoryForDeserialization);
Instance\ProjectTaskOutputItemInstance.cs (16)
37private ElementLocation _location;
42private ElementLocation _itemTypeLocation;
47private ElementLocation _taskParameterLocation;
52private ElementLocation _conditionLocation;
57internal ProjectTaskOutputItemInstance(string itemType, string taskParameter, string condition, ElementLocation location, ElementLocation itemTypeLocation, ElementLocation taskParameterLocation, ElementLocation conditionLocation)
106public override ElementLocation Location
114public override ElementLocation ConditionLocation
122public override ElementLocation TaskParameterLocation
130public ElementLocation ItemTypeLocation
146translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
147translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
148translator.Translate(ref _itemTypeLocation, ElementLocation.FactoryForDeserialization);
149translator.Translate(ref _taskParameterLocation, ElementLocation.FactoryForDeserialization);
Instance\ProjectTaskOutputPropertyInstance.cs (16)
37private ElementLocation _location;
42private ElementLocation _propertyNameLocation;
47private ElementLocation _taskParameterLocation;
52private ElementLocation _conditionLocation;
57internal ProjectTaskOutputPropertyInstance(string propertyName, string taskParameter, string condition, ElementLocation location, ElementLocation propertyNameLocation, ElementLocation taskParameterLocation, ElementLocation conditionLocation)
106public ElementLocation PropertyNameLocation
114public override ElementLocation Location
122public override ElementLocation ConditionLocation
130public override ElementLocation TaskParameterLocation
146translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
147translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
148translator.Translate(ref _propertyNameLocation, ElementLocation.FactoryForDeserialization);
149translator.Translate(ref _taskParameterLocation, ElementLocation.FactoryForDeserialization);
Instance\TaskFactories\AssemblyTaskFactory.cs (7)
25using ElementLocation = Microsoft.Build.Construction.ElementLocation;
247ElementLocation elementLocation,
285ElementLocation.Create(taskProjectFile),
312ElementLocation taskLocation,
404ElementLocation.Create(taskLoc, taskLine, taskColumn),
466internal bool TaskNameCreatableByFactory(string taskName, in TaskHostParameters taskIdentityParameters, string taskProjectFile, TargetLoggingContext targetLoggingContext, ElementLocation elementLocation)
493ElementLocation.Create(taskProjectFile),
Instance\TaskRegistry.cs (7)
262ElementLocation elementLocation,
321ElementLocation elementLocation,
552ElementLocation elementLocation,
1075internal bool CanTaskBeCreatedByFactory(string taskName, string taskProjectFile, TaskHostParameters taskIdentityParameters, TargetLoggingContext targetLoggingContext, ElementLocation elementLocation, bool isMultiThreadedBuild)
1184internal TaskFactoryWrapper GetTaskFactoryFromRegistrationRecord(string taskName, string taskProjectFile, in TaskHostParameters taskIdentityParameters, TargetLoggingContext targetLoggingContext, ElementLocation elementLocation, bool isMultiThreadedBuild)
1199private bool GetTaskFactory(TargetLoggingContext targetLoggingContext, ElementLocation elementLocation, string taskProjectFile, bool isMultiThreadedBuild)
1282ElementLocation.Create(taskProjectFile),