1 write to _loadedProject
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\ProjectFile.cs (1)
34_loadedProject = loadedProject;
50 references to _loadedProject
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (50)
MSBuild\ProjectFile\ProjectFile.cs (50)
28public virtual string FilePath => _loadedProject?.FullPath ?? string.Empty; 53if (_loadedProject is null) 55return [ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath)]; 58var targetFrameworkValue = _loadedProject.GetPropertyValue(PropertyNames.TargetFramework); 59var targetFrameworksValue = _loadedProject.GetPropertyValue(PropertyNames.TargetFrameworks); 69if (!_loadedProject.GlobalProperties.TryGetValue(PropertyNames.TargetFramework, out var initialGlobalTargetFrameworkValue)) 75_loadedProject.SetGlobalProperty(PropertyNames.TargetFramework, targetFramework); 76_loadedProject.ReevaluateIfNecessary(); 85_loadedProject.RemoveGlobalProperty(PropertyNames.TargetFramework); 89_loadedProject.SetGlobalProperty(PropertyNames.TargetFramework, initialGlobalTargetFrameworkValue); 92_loadedProject.ReevaluateIfNecessary(); 99projectFileInfo ??= ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath); 106if (_loadedProject is null) 108return ProjectFileInfo.CreateEmpty(Language, _loadedProject?.FullPath); 111var project = await _buildManager.BuildProjectAsync(_loadedProject, Log, cancellationToken).ConfigureAwait(false); 115: ProjectFileInfo.CreateEmpty(Language, _loadedProject.FullPath); 182var fileGlobs = _loadedProject?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? []; 307if (_loadedProject is null) 312foreach (var item in _loadedProject.GetItems(ItemNames.Compile)) 361if (_loadedProject is null) 366var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 379_loadedProject.AddItem(ItemNames.Compile, relativePath, metadata); 384if (_loadedProject is null) 389var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 391var items = _loadedProject.GetItems(ItemNames.Compile); 396_loadedProject.RemoveItem(item); 402if (_loadedProject is null) 414_loadedProject.AddItem(ItemNames.Reference, metadataReferenceIdentity, metadata); 419if (_loadedProject is null) 427_loadedProject.RemoveItem(item); 433Contract.ThrowIfNull(_loadedProject, "The project was not loaded."); 435var references = _loadedProject.GetItems(ItemNames.Reference); 451var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, filePath); 476if (_loadedProject is null) 491var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, reference.Path); 492_loadedProject.AddItem(ItemNames.ProjectReference, relativePath, metadata); 497if (_loadedProject is null) 505_loadedProject.RemoveItem(item); 511if (_loadedProject is null) 516var references = _loadedProject.GetItems(ItemNames.ProjectReference); 517var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, projectFilePath); 533if (_loadedProject is null) 538var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, fullPath); 539_loadedProject.AddItem(ItemNames.Analyzer, relativePath); 544if (_loadedProject is null) 549var relativePath = PathUtilities.GetRelativePath(_loadedProject.DirectoryPath, fullPath); 551var analyzers = _loadedProject.GetItems(ItemNames.Analyzer); 556_loadedProject.RemoveItem(item); 562if (_loadedProject is null) 567_loadedProject.Save();