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)
28
public virtual string FilePath =>
_loadedProject
?.FullPath ?? string.Empty;
53
if (
_loadedProject
is null)
55
return [ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath)];
58
var targetFrameworkValue =
_loadedProject
.GetPropertyValue(PropertyNames.TargetFramework);
59
var targetFrameworksValue =
_loadedProject
.GetPropertyValue(PropertyNames.TargetFrameworks);
69
if (!
_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();
99
projectFileInfo ??= ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath);
106
if (
_loadedProject
is null)
108
return ProjectFileInfo.CreateEmpty(Language,
_loadedProject
?.FullPath);
111
var project = await _buildManager.BuildProjectAsync(
_loadedProject
, Log, cancellationToken).ConfigureAwait(false);
115
: ProjectFileInfo.CreateEmpty(Language,
_loadedProject
.FullPath);
182
var fileGlobs =
_loadedProject
?.GetAllGlobs().Select(GetFileGlobs).ToImmutableArray() ?? [];
307
if (
_loadedProject
is null)
312
foreach (var item in
_loadedProject
.GetItems(ItemNames.Compile))
361
if (
_loadedProject
is null)
366
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
379
_loadedProject
.AddItem(ItemNames.Compile, relativePath, metadata);
384
if (
_loadedProject
is null)
389
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
391
var items =
_loadedProject
.GetItems(ItemNames.Compile);
396
_loadedProject
.RemoveItem(item);
402
if (
_loadedProject
is null)
414
_loadedProject
.AddItem(ItemNames.Reference, metadataReferenceIdentity, metadata);
419
if (
_loadedProject
is null)
427
_loadedProject
.RemoveItem(item);
433
Contract.ThrowIfNull(
_loadedProject
, "The project was not loaded.");
435
var references =
_loadedProject
.GetItems(ItemNames.Reference);
451
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, filePath);
476
if (
_loadedProject
is null)
491
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, reference.Path);
492
_loadedProject
.AddItem(ItemNames.ProjectReference, relativePath, metadata);
497
if (
_loadedProject
is null)
505
_loadedProject
.RemoveItem(item);
511
if (
_loadedProject
is null)
516
var references =
_loadedProject
.GetItems(ItemNames.ProjectReference);
517
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, projectFilePath);
533
if (
_loadedProject
is null)
538
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, fullPath);
539
_loadedProject
.AddItem(ItemNames.Analyzer, relativePath);
544
if (
_loadedProject
is null)
549
var relativePath = PathUtilities.GetRelativePath(
_loadedProject
.DirectoryPath, fullPath);
551
var analyzers =
_loadedProject
.GetItems(ItemNames.Analyzer);
556
_loadedProject
.RemoveItem(item);
562
if (
_loadedProject
is null)
567
_loadedProject
.Save();