1 write to _loadedProject
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\ProjectFile.cs (1)
32_loadedProject = loadedProject;
50 references to _loadedProject
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (50)
MSBuild\ProjectFile\ProjectFile.cs (50)
26public virtual string FilePath => _loadedProject?.FullPath ?? string.Empty; 51if (_loadedProject is null) 53return [ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath)]; 56var targetFrameworkValue = _loadedProject.GetPropertyValue(PropertyNames.TargetFramework); 57var targetFrameworksValue = _loadedProject.GetPropertyValue(PropertyNames.TargetFrameworks); 67if (!_loadedProject.GlobalProperties.TryGetValue(PropertyNames.TargetFramework, out var initialGlobalTargetFrameworkValue)) 73_loadedProject.SetGlobalProperty(PropertyNames.TargetFramework, targetFramework); 74_loadedProject.ReevaluateIfNecessary(); 83_loadedProject.RemoveGlobalProperty(PropertyNames.TargetFramework); 87_loadedProject.SetGlobalProperty(PropertyNames.TargetFramework, initialGlobalTargetFrameworkValue); 90_loadedProject.ReevaluateIfNecessary(); 97projectFileInfo ??= ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath); 104if (_loadedProject is null) 106return ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath); 109var project = await _buildManager.BuildProjectAsync(_loadedProject, Log, cancellationToken).ConfigureAwait(false); 113: ProjectFileInfo.CreateEmpty(Language, _loadedProject.FullPath); 180var fileGlobs = _loadedProject?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? []; 308if (_loadedProject is null) 313foreach (var item in _loadedProject.GetItems(ItemNames.Compile)) 362if (_loadedProject is null) 367var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 380_loadedProject.AddItem(ItemNames.Compile, relativePath, metadata); 385if (_loadedProject is null) 390var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 392var items = _loadedProject.GetItems(ItemNames.Compile); 397_loadedProject.RemoveItem(item); 403if (_loadedProject is null) 415_loadedProject.AddItem(ItemNames.Reference, metadataReferenceIdentity, metadata); 420if (_loadedProject is null) 428_loadedProject.RemoveItem(item); 434Contract.ThrowIfNull(_loadedProject, "The project was not loaded."); 436var references = _loadedProject.GetItems(ItemNames.Reference); 452var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 477if (_loadedProject is null) 492var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, reference.Path); 493_loadedProject.AddItem(ItemNames.ProjectReference, relativePath, metadata); 498if (_loadedProject is null) 506_loadedProject.RemoveItem(item); 512if (_loadedProject is null) 517var references = _loadedProject.GetItems(ItemNames.ProjectReference); 518var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, projectFilePath); 534if (_loadedProject is null) 539var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, fullPath); 540_loadedProject.AddItem(ItemNames.Analyzer, relativePath); 545if (_loadedProject is null) 550var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, fullPath); 552var analyzers = _loadedProject.GetItems(ItemNames.Analyzer); 557_loadedProject.RemoveItem(item); 563if (_loadedProject is null) 568_loadedProject.Save();