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)
26
public virtual string FilePath =>
_loadedProject
?.FullPath ?? string.Empty;
51
if (
_loadedProject
is null)
53
return [ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath)];
56
var targetFrameworkValue =
_loadedProject
.GetPropertyValue(PropertyNames.TargetFramework);
57
var targetFrameworksValue =
_loadedProject
.GetPropertyValue(PropertyNames.TargetFrameworks);
67
if (!
_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();
97
projectFileInfo ??= ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath);
104
if (
_loadedProject
is null)
106
return ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath);
109
var project = await _buildManager.BuildProjectAsync(
_loadedProject
, Log, cancellationToken).ConfigureAwait(false);
113
: ProjectFileInfo.CreateEmpty(Language,
_loadedProject
.FullPath);
180
var fileGlobs =
_loadedProject
?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? [];
308
if (
_loadedProject
is null)
313
foreach (var item in
_loadedProject
.GetItems(ItemNames.Compile))
362
if (
_loadedProject
is null)
367
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
380
_loadedProject
.AddItem(ItemNames.Compile, relativePath, metadata);
385
if (
_loadedProject
is null)
390
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
392
var items =
_loadedProject
.GetItems(ItemNames.Compile);
397
_loadedProject
.RemoveItem(item);
403
if (
_loadedProject
is null)
415
_loadedProject
.AddItem(ItemNames.Reference, metadataReferenceIdentity, metadata);
420
if (
_loadedProject
is null)
428
_loadedProject
.RemoveItem(item);
434
Contract.ThrowIfNull(
_loadedProject
, "The project was not loaded.");
436
var references =
_loadedProject
.GetItems(ItemNames.Reference);
452
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
477
if (
_loadedProject
is null)
492
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, reference.Path);
493
_loadedProject
.AddItem(ItemNames.ProjectReference, relativePath, metadata);
498
if (
_loadedProject
is null)
506
_loadedProject
.RemoveItem(item);
512
if (
_loadedProject
is null)
517
var references =
_loadedProject
.GetItems(ItemNames.ProjectReference);
518
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, projectFilePath);
534
if (
_loadedProject
is null)
539
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, fullPath);
540
_loadedProject
.AddItem(ItemNames.Analyzer, relativePath);
545
if (
_loadedProject
is null)
550
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, fullPath);
552
var analyzers =
_loadedProject
.GetItems(ItemNames.Analyzer);
557
_loadedProject
.RemoveItem(item);
563
if (
_loadedProject
is null)
568
_loadedProject
.Save();