21 instantiations of ProjectInstance
dotnet (4)
Commands\Reference\List\ReferenceListCommand.cs (1)
36
ProjectInstance projectInstance =
new
(msbuildProj.ProjectRootElement);
Commands\Solution\Add\SolutionAddCommand.cs (1)
177
ProjectInstance projectInstance = new
ProjectInstance
(projectRootElement);
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
82
var project = new
ProjectInstance
(projectFile, globalProperties, null);
ReleasePropertyProjectLocator.cs (1)
241
return new
ProjectInstance
(projectPath, globalProperties, "Current");
Microsoft.Build (15)
BackEnd\BuildManager\BuildManager.cs (1)
2172
return new
ProjectInstance
(
BackEnd\Shared\BuildRequestConfiguration.cs (1)
508
return new
ProjectInstance
(
Construction\Solution\SolutionProjectGenerator.cs (2)
1037
var traversalInstance = new
ProjectInstance
(
1274
ProjectInstance metaprojectInstance = new
ProjectInstance
(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject));
Definition\Project.cs (1)
3716
return new
ProjectInstance
(_data, DirectoryPath, FullPath, ProjectCollection.HostServices, ProjectCollection.EnvironmentProperties, settings);
Graph\ProjectGraph.cs (1)
959
return new
ProjectInstance
(
Instance\ProjectInstance.cs (9)
199
/// of another ProjectInstance. <seealso cref="
ProjectInstance
(ProjectInstance, bool, RequestedProjectState)"/>
920
return new
ProjectInstance
(
939
return new
ProjectInstance
(
959
return new
ProjectInstance
(project, fastItemLookupNeeded);
1309
/// of another ProjectInstance. <seealso cref="
ProjectInstance
(ProjectInstance, bool, RequestedProjectState)"/>
2158
return new
ProjectInstance
(this, true, filter);
2174
return new
ProjectInstance
(this, isImmutable);
2763
return new
ProjectInstance
(translator);
3105
ProjectInstance instance =
new
(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId);
Microsoft.DotNet.HotReload.Watch (1)
Build\ProjectGraphFactory.cs (1)
147
return new
ProjectInstance
(
NuGet.CommandLine.XPlat (1)
Utility\MSBuildAPIUtility.cs (1)
934
var newProject = new
ProjectInstance
(project.Xml, globalProperties, null, ProjectCollection.GlobalProjectCollection);
351 references to ProjectInstance
dotnet (61)
Commands\Project\Convert\ProjectConvertCommand.cs (7)
57
out
var
projectInstance,
114
ProjectInstance
fileProjectInstance;
344
VirtualProjectBuilder fileBuilder,
ProjectInstance
fileProjectInstance, string sourceFile)
423
var
outputProject =
ProjectInstance
.FromFile(projectFile, new ProjectOptions
465
string? DetermineUserSecretsId(
ProjectInstance
projectInstance)
555
IEnumerable<(string name, string value)> GetDefaultProperties(
ProjectInstance
projectInstance)
Commands\Reference\List\ReferenceListCommand.cs (1)
36
ProjectInstance
projectInstance = new(msbuildProj.ProjectRootElement);
Commands\Run\EnvironmentVariablesToMSBuild.cs (1)
26
public static void AddAsItems(
ProjectInstance
projectInstance, IReadOnlyDictionary<string, string> environmentVariables)
Commands\Run\RunCommand.cs (11)
179
Func<ProjectCollection,
ProjectInstance
>? projectFactory = null;
237
internal ICommand GetTargetCommand(LaunchProfile? launchSettings, Func<ProjectCollection,
ProjectInstance
>? projectFactory, RunProperties? cachedRunProperties, FacadeLogger? logger)
468
private void EnsureProjectIsBuilt(out Func<ProjectCollection,
ProjectInstance
>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? projectBuilder, string? intermediateOutputPath, bool hasRuntimeEnvironmentVariableSupport)
564
private ICommand GetTargetCommandForProject(ProjectLaunchProfile? launchSettings, Func<ProjectCollection,
ProjectInstance
>? projectFactory, RunProperties? cachedRunProperties, FacadeLogger? logger)
586
ProjectInstance
project;
610
static
ProjectInstance
EvaluateProject(string? projectFilePath, Func<ProjectCollection,
ProjectInstance
>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger)
630
static void ValidatePreconditions(
ProjectInstance
project)
683
static void InvokeRunArgumentsTarget(
ProjectInstance
project, bool noBuild, FacadeLogger? binaryLogger, MSBuildArgs buildArgs, IReadOnlyDictionary<string, string> environmentVariables)
710
internal static void ThrowUnableToRunError(
ProjectInstance
project)
1122
var
project = collection.LoadProject(ProjectFileFullPath).CreateProjectInstance();
Commands\Run\RunCommandSelector.cs (7)
55
if (OpenProjectIfNeeded(out
var
projectInstance))
72
if (OpenProjectIfNeeded(out
var
projectInstance))
118
if (!OpenProjectIfNeeded(out
var
projectInstance))
174
private bool OpenProjectIfNeeded([NotNullWhen(true)] out
ProjectInstance
? projectInstance)
218
private
ProjectInstance
CreateRestoreProjectInstance()
328
if (!OpenProjectIfNeeded(out
var
projectInstance))
568
if (!OpenProjectIfNeeded(out
var
projectInstance))
Commands\Run\RunProperties.cs (2)
23
internal static bool TryFromProject(
ProjectInstance
project, [NotNullWhen(returnValue: true)] out RunProperties? result)
42
internal static RunProperties FromProject(
ProjectInstance
project)
Commands\Run\RunTelemetry.cs (2)
193
public static int CountPackageReferences(
ProjectInstance
project)
203
public static int CountProjectReferences(
ProjectInstance
project)
Commands\Run\VirtualProjectBuildingCommand.cs (7)
303
ProjectInstance
? projectInstance = null;
522
bool CanSaveCache(
ProjectInstance
projectInstance)
553
void CollectAdditionalSources(CacheInfo cache,
ProjectInstance
projectInstance)
581
void PrintBuildInformation(ProjectCollection projectCollection,
ProjectInstance
projectInstance, BuildResult? buildOrRestoreResult)
1175
public
ProjectInstance
CreateProjectInstance(ProjectCollection projectCollection)
1180
public
ProjectInstance
CreateProjectInstance(ProjectCollection projectCollection, Action<IDictionary<string, string>>? addGlobalProperties)
1185
out
var
project,
Commands\Solution\Add\SolutionAddCommand.cs (1)
177
ProjectInstance
projectInstance = new ProjectInstance(projectRootElement);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (2)
168
var
projectInstance =
ProjectInstance
.FromFile(projectPath, new ProjectOptions
Commands\Test\MTP\SolutionAndProjectUtility.cs (7)
169
private static
ProjectInstance
EvaluateProject(
227
return
ProjectInstance
.FromFile(projectFilePath, new ProjectOptions
244
ProjectInstance
projectInstance = EvaluateProject(projectCollection, evaluationContext, projectFilePath, tfm: null, configuration, platform);
345
var
projectInstance =
ProjectInstance
.FromFile(projectFilePath, new ProjectOptions
442
private static TestModule? GetModuleFromProject(
ProjectInstance
project, BuildOptions buildOptions)
500
static RunProperties GetRunProperties(
ProjectInstance
project)
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
82
var
project = new ProjectInstance(projectFile, globalProperties, null);
Extensions\ProjectInstanceExtensions.cs (4)
10
public static string GetProjectId(this
ProjectInstance
projectInstance)
19
public static string GetDefaultProjectTypeGuid(this
ProjectInstance
projectInstance)
29
public static IEnumerable<string> GetPlatforms(this
ProjectInstance
projectInstance)
37
public static IEnumerable<string> GetConfigurations(this
ProjectInstance
projectInstance)
ReleasePropertyProjectLocator.cs (8)
64
ProjectInstance
? project = GetTargetedProject(globalProperties);
95
public
ProjectInstance
? GetTargetedProject(ReadOnlyDictionary<string, string>? globalProps)
134
public
ProjectInstance
? GetArbitraryProjectFromSolution(string slnPath, ReadOnlyDictionary<string, string>? globalProps)
152
List<
ProjectInstance
> configuredProjects = [];
170
var
projectData = TryGetProjectInstance(projectFullPath, globalProps);
204
private
ProjectInstance
? GetSingleProjectFromSolution(SolutionModel sln, string slnPath, ReadOnlyDictionary<string, string>? globalProps)
214
var
projectData = TryGetProjectInstance(projectFullPath, globalProps);
237
private static
ProjectInstance
? TryGetProjectInstance(string projectPath, ReadOnlyDictionary<string, string>? globalProperties)
Microsoft.Build (171)
BackEnd\BuildManager\BuildManager.cs (6)
191
private readonly Dictionary<
ProjectInstance
, string> _unnamedProjectInstanceToNames;
306
_unnamedProjectInstanceToNames = new Dictionary<
ProjectInstance
, string>();
926
public
ProjectInstance
GetProjectInstanceForBuild(Project project)
1507
ProjectInstance
? projectInstance = submission.BuildRequestData.ProjectInstance;
1736
var instances =
ProjectInstance
.LoadSolutionForBuild(
1781
ProjectInstance
newInstance = project.CreateProjectInstance();
BackEnd\BuildManager\BuildRequestData.cs (6)
22
public BuildRequestData(
ProjectInstance
projectInstance, string[] targetsToBuild)
33
public BuildRequestData(
ProjectInstance
projectInstance, string[] targetsToBuild, HostServices hostServices)
45
public BuildRequestData(
ProjectInstance
projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags)
58
public BuildRequestData(
ProjectInstance
projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer)
87
public BuildRequestData(
ProjectInstance
projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer, RequestedProjectState requestedProjectState)
167
public
ProjectInstance
? ProjectInstance
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
173
private IEnumerable<ProjectCacheDescriptor> GetProjectCacheDescriptors(
ProjectInstance
projectInstance)
BackEnd\Components\RequestBuilder\IntrinsicTask.cs (3)
25
protected IntrinsicTask(TargetLoggingContext loggingContext,
ProjectInstance
projectInstance, bool logTaskInputs)
44
internal
ProjectInstance
Project
67
internal static IntrinsicTask InstantiateTask(ProjectTargetInstanceChild taskInstance, TargetLoggingContext loggingContext,
ProjectInstance
projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
42
public ItemGroupIntrinsicTask(ProjectItemGroupTaskInstance taskInstance, TargetLoggingContext loggingContext,
ProjectInstance
projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\PropertyGroupIntrinsicTask.cs (1)
37
public PropertyGroupIntrinsicTask(ProjectPropertyGroupTaskInstance taskInstance, TargetLoggingContext loggingContext,
ProjectInstance
projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
1485
ProjectInstance
project = _requestEntry?.RequestConfiguration?.Project;
1525
ProjectInstance
project = _requestEntry?.RequestConfiguration?.Project;
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
86
private
ProjectInstance
_projectInstance;
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (2)
56
internal TargetUpToDateChecker(
ProjectInstance
project, ProjectTargetInstance targetToAnalyze, ILoggingService loggingServices, BuildEventContext buildEventContext)
1234
private
ProjectInstance
_project;
BackEnd\Shared\BuildRequestConfiguration.cs (8)
89
private
ProjectInstance
_project;
94
private
ProjectInstance
_transferredState;
218
internal BuildRequestConfiguration(int configId,
ProjectInstance
instance)
398
public
ProjectInstance
Project
433
private void SetProjectBasedState(
ProjectInstance
project)
528
private void InitializeProject(BuildParameters buildParameters, Func<
ProjectInstance
> loadProjectFromFile)
953
translator.Translate(ref _transferredState,
ProjectInstance
.FactoryForDeserialization);
996
internal void ApplyTransferredState(
ProjectInstance
instance)
BackEnd\Shared\BuildResult.cs (11)
130
/// <see cref="
ProjectInstance
"/> state after the build. This is only provided if <see cref="BuildRequest.BuildRequestDataFlags"/>
134
/// be used to retrieve <see cref="
ProjectInstance
.Properties"/>, <see cref="
ProjectInstance
.GlobalProperties"/> and
135
/// <see cref="
ProjectInstance
.Items"/> from it. No other operation is guaranteed to be supported.
137
private
ProjectInstance
? _projectStateAfterBuild;
414
/// <see cref="
ProjectInstance
"/> state after the build. In general, it may be a non buildable-dummy object, and should only
415
/// be used to retrieve <see cref="
ProjectInstance
.Properties"/>, <see cref="
ProjectInstance
.GlobalProperties"/> and
416
/// <see cref="
ProjectInstance
.Items"/> from it. Any other operation is not guaranteed to be supported.
418
public
ProjectInstance
? ProjectStateAfterBuild
649
translator.Translate(ref _projectStateAfterBuild,
ProjectInstance
.FactoryForDeserialization);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (3)
87
private
ProjectInstance
_projectInstance;
218
public
ProjectInstance
ProjectInstance => _projectInstance;
265
ProjectInstance
projectInstance,
Construction\Solution\SolutionProjectGenerator.cs (35)
209
internal static
ProjectInstance
[] Generate(
739
private
ProjectInstance
[] Generate()
766
private
ProjectInstance
[] CreateSolutionProject(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified)
794
var projectInstances = new List<
ProjectInstance
>(projectsInOrder.Count + 1);
797
ProjectInstance
traversalInstance = CreateTraversalInstance(wrapperProjectToolsVersion, explicitToolsVersionSpecified, projectsInOrder);
826
foreach (
ProjectInstance
instance in projectInstances)
837
private void EvaluateAndAddProjects(List<ProjectInSolution> projectsInOrder, List<
ProjectInstance
> projectInstances,
ProjectInstance
traversalInstance, string selectedSolutionConfiguration)
872
ProjectInstance
metaproject = CreateMetaproject(traversalInstance, project, projectConfiguration);
887
private void AddStandardTraversalTargets(
ProjectInstance
traversalInstance, List<ProjectInSolution> projectsInOrder)
902
private
ProjectInstance
CreateTraversalInstance(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified, List<ProjectInSolution> projectsInOrder)
1037
var
traversalInstance = new ProjectInstance(
1115
private void AddProjectReference(
ProjectInstance
traversalProject,
ProjectInstance
projectInstance, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration, bool direct)
1148
private static string GetToolsVersionMetadataForDirectMSBuildTask(
ProjectInstance
traversalProject)
1165
private static string GetPropertiesMetadataForProjectReference(
ProjectInstance
traversalProject, string configurationAndPlatformProperties)
1204
private bool CanBuildDirectly(
ProjectInstance
traversalProject, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration)
1271
private
ProjectInstance
CreateMetaproject(
ProjectInstance
traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration)
1274
ProjectInstance
metaprojectInstance = new ProjectInstance(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject));
1376
private void AddMetaprojectReferenceItems(
ProjectInstance
traversalProject,
ProjectInstance
metaprojectInstance, ProjectInSolution project)
1404
private static void AddMetaprojectTargetForManagedProject(
ProjectInstance
traversalProject,
ProjectInstance
metaprojectInstance, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetName, string outputItem)
1423
private static void AddProjectBuildTask(
ProjectInstance
traversalProject, ProjectConfigurationInSolution projectConfiguration, ProjectTargetInstance target, string targetToBuild, string sourceItems, string condition, string outputItem)
1922
private void AddMetaprojectTargetForUnknownProjectType(
ProjectInstance
traversalProject,
ProjectInstance
metaprojectInstance, ProjectInSolution project, string targetName, string unknownProjectTypeErrorMessage)
1992
private void AddValidateProjectsTarget(
ProjectInstance
traversalProject, List<ProjectInSolution> projects)
2034
private static void AddTraversalReferencesTarget(
ProjectInstance
traversalProject, string targetName, string outputItem, bool batchBuildTargets)
2086
private void AddTraversalTargetForProject(
ProjectInstance
traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetToBuild, string outputItem, bool canBuildDirectly)
2131
private IDictionary<string, string> GetMetaprojectGlobalProperties(
ProjectInstance
traversalProject)
2404
private void AddInitialTargets(
ProjectInstance
traversalProject, List<ProjectInSolution> projects)
2415
private void AddValidateSolutionConfigurationTarget(
ProjectInstance
traversalProject)
2450
private static void AddValidateToolsVersionsTarget(
ProjectInstance
traversalProject)
2463
private static void AddGetSolutionConfigurationContentsTarget(
ProjectInstance
traversalProject)
Definition\Project.cs (6)
1367
public
ProjectInstance
CreateProjectInstance()
1381
public
ProjectInstance
CreateProjectInstance(ProjectInstanceSettings settings)
1392
public
ProjectInstance
CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext)
3282
public override
ProjectInstance
CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext)
3350
ProjectInstance
instance = CreateProjectInstance(LoggingService, ProjectInstanceSettings.None, evaluationContext);
3709
private
ProjectInstance
CreateProjectInstance(
Graph\GraphBuilder.cs (4)
54
private ConcurrentDictionary<ConfigurationMetadata, Lazy<
ProjectInstance
>> _platformNegotiationInstancesCache = new();
537
ProjectInstance
projectInstance;
640
private
ProjectInstance
GetInstanceForPlatformNegotiationWithCaching(
647
new Lazy<
ProjectInstance
>(() => _projectInstanceFactory(projectPath, globalProperties, projectCollection))).Value;
Graph\ProjectGraph.cs (9)
33
/// A callback used for constructing a <see cref="
ProjectInstance
" /> for a specific
39
/// <returns>A <see cref="
ProjectInstance
" /> instance. This value must not be null.</returns>
55
public delegate
ProjectInstance
ProjectInstanceFactoryFunc(
177
/// A delegate used for constructing a <see cref="
ProjectInstance
" />, called for each
318
/// A delegate used for constructing a <see cref="
ProjectInstance
" />, called for each
355
/// A delegate used for constructing a <see cref="
ProjectInstance
" />, called for each
396
/// A delegate used for constructing a <see cref="
ProjectInstance
" />, called for each
939
internal
ProjectInstance
DefaultProjectInstanceFactory(
953
internal static
ProjectInstance
StaticProjectInstanceFactory(
Graph\ProjectGraphNode.cs (2)
25
internal ProjectGraphNode(
ProjectInstance
projectInstance)
46
public
ProjectInstance
ProjectInstance { get; }
Graph\ProjectInterpretation.cs (9)
80
ProjectInstance
requesterInstance = projectGraphNode.ProjectInstance;
178
var
projectInstance = projectInstanceFactory(
209
internal static string GetInnerBuildPropertyValue(
ProjectInstance
project)
214
internal static string GetInnerBuildPropertyName(
ProjectInstance
project)
219
internal static string GetInnerBuildPropertyValues(
ProjectInstance
project)
224
internal static ProjectType GetProjectType(
ProjectInstance
project)
279
private static IEnumerable<ProjectItemInstance> ConstructInnerBuildReferences(
ProjectInstance
outerBuild)
508
public static TargetsToPropagate FromProjectAndEntryTargets(
ProjectInstance
project, string[] entryTargets)
595
ProjectInstance
projectInstance = projectGraphNode.ProjectInstance;
Instance\ProjectInstance.cs (29)
199
/// of another ProjectInstance. <seealso cref="ProjectInstance(
ProjectInstance
, bool, RequestedProjectState)"/>
423
/// The resulting <see cref="
ProjectInstance
"/> object wraps the <see cref="Project"/>
563
internal ProjectInstance(string projectFile,
ProjectInstance
projectToInheritFrom, IDictionary<string, string> globalProperties)
626
/// Initializes a new instance of the <see cref="
ProjectInstance
"/> class directly.
739
private ProjectInstance(
ProjectInstance
that, bool isImmutable, RequestedProjectState filter = null)
918
public static
ProjectInstance
FromFile(string file, ProjectOptions options)
937
public static
ProjectInstance
FromProjectRootElement(ProjectRootElement rootElement, ProjectOptions options)
956
public static
ProjectInstance
FromImmutableProjectSource(Project project, ProjectInstanceSettings settings)
980
ProjectInstance
owningProjectInstance)
1002
ProjectInstance
owningProjectInstance,
1309
/// of another ProjectInstance. <seealso cref="ProjectInstance(
ProjectInstance
, bool, RequestedProjectState)"/>
1389
/// Adds an Environment Variable that was resolved by an <see cref="SdkResolver"/> to the set of properties tracked by this <see cref="
ProjectInstance
"/>.
2141
public
ProjectInstance
DeepCopy()
2156
public
ProjectInstance
FilteredCopy(RequestedProjectState filter)
2166
public
ProjectInstance
DeepCopy(bool isImmutable)
2423
/// from the <see cref="
ProjectInstance
"/> provided.
2425
/// <param name="projectState"><see cref="
ProjectInstance
"/> with the state to use.</param>
2426
public void UpdateStateFrom(
ProjectInstance
projectState)
2443
Assumed.NotNull(TaskRegistry, $"{nameof(TaskRegistry)} Cannot be null after {nameof(
ProjectInstance
)} object creation.");
2623
internal static
ProjectInstance
[] LoadSolutionForBuild(
2641
ProjectInstance
[] projectInstances = null;
2687
private static
ProjectInstance
[] CalculateToolsVersionAndGenerateSolutionWrapper(
2713
ProjectInstance
[] projectInstances = null;
2761
internal static
ProjectInstance
FactoryForDeserialization(ITranslator translator)
2978
private static
ProjectInstance
[] GenerateSolutionWrapper(
3004
ProjectInstance
[] instances = SolutionProjectGenerator.Generate(sp, globalProperties, toolsVersion, projectBuildEventContext, loggingService, targetNames, sdkResolverService, submissionId);
3031
private static
ProjectInstance
[] GenerateSolutionWrapperUsingOldOM(
3105
ProjectInstance
instance = new(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId);
3487
ProjectInstance
projectInstance,
Instance\ProjectItemInstance.cs (30)
49
private
ProjectInstance
_project;
70
internal ProjectItemInstance(
ProjectInstance
project, string itemType, string includeEscaped, string definingFileEscaped)
82
internal ProjectItemInstance(
ProjectInstance
project, string itemType, string includeEscaped, string includeBeforeWildcardExpansionEscaped, string definingFileEscaped)
101
ProjectInstance
project,
124
internal ProjectItemInstance(
ProjectInstance
project, string itemType, string includeEscaped, IEnumerable<KeyValuePair<string, string>> directMetadata, string definingFileEscaped)
148
private ProjectItemInstance(ProjectItemInstance that,
ProjectInstance
newProject)
158
private ProjectItemInstance(
ProjectInstance
projectInstance)
169
public
ProjectInstance
Project
638
internal static ProjectItemInstance FactoryForDeserialization(ITranslator translator,
ProjectInstance
projectInstance)
696
internal ProjectItemInstance DeepClone(
ProjectInstance
newProject)
728
ProjectInstance
projectToUse,
933
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
959
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1056
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1154
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1173
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1462
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1473
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1484
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1530
ProjectInstance
.VerifyThrowNotImmutable(destinationAsTaskItem._isImmutable);
1845
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1966
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
1983
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
2004
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
2023
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
2034
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
2049
ProjectInstance
.VerifyThrowNotImmutable(_isImmutable);
2211
private
ProjectInstance
_project;
2218
internal ProjectItemInstanceFactory(
ProjectInstance
project)
2226
internal ProjectItemInstanceFactory(
ProjectInstance
project, string itemType)
Instance\ProjectPropertyInstance.cs (1)
76
ProjectInstance
.VerifyThrowNotImmutable(IsImmutable);
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (1)
234
public abstract
ProjectInstance
CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (1)
32
public HotReloadMSBuildWorkspace(ILogger logger, Func<string, (ImmutableArray<MSB.Execution.
ProjectInstance
> instances, MSB.Evaluation.Project? project)> getBuildProjects)
Api\HotReloadMSBuildWorkspace.ProjectFileInfoProvider.cs (1)
18
Func<string, (ImmutableArray<MSB.Execution.
ProjectInstance
> instances, MSB.Evaluation.Project? project)> getBuildProjects,
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (38)
Build\ProjectBuildManager.cs (6)
214
public async Task<MSB.Execution.
ProjectInstance
[]> BuildProjectInstancesAsync(
236
var results = new List<MSB.Execution.
ProjectInstance
>(targetFrameworks.Length);
242
var
projectInstance = await BuildProjectInstanceAsync(project, log, cancellationToken).ConfigureAwait(false);
260
private Task<MSB.Execution.
ProjectInstance
> BuildProjectInstanceAsync(
269
private async Task<MSB.Execution.
ProjectInstance
> BuildProjectInstanceAsync(
274
var
projectInstance = project.CreateProjectInstance();
MSBuild\CSharp\CSharpCommandLineArgumentReader.cs (2)
11
private CSharpCommandLineArgumentReader(MSB.Execution.
ProjectInstance
project)
16
public static string[] Read(MSB.Execution.
ProjectInstance
project)
MSBuild\CSharp\CSharpProjectCommandLineReader.cs (2)
17
public override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.
ProjectInstance
executedProject)
20
public override string[] ReadCommandLineArgs(MSB.Execution.
ProjectInstance
project)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (2)
15
protected readonly MSB.Execution.
ProjectInstance
Project;
18
protected CommandLineArgumentReader(MSB.Execution.
ProjectInstance
project)
MSBuild\ProjectFile\Extensions.cs (16)
15
public static IEnumerable<MSB.Framework.ITaskItem> GetAdditionalFiles(this MSB.Execution.
ProjectInstance
executedProject)
18
public static IEnumerable<MSB.Framework.ITaskItem> GetAnalyzers(this MSB.Execution.
ProjectInstance
executedProject)
21
public static IEnumerable<MSB.Framework.ITaskItem> GetDocuments(this MSB.Execution.
ProjectInstance
executedProject)
24
public static IEnumerable<MSB.Framework.ITaskItem> GetEditorConfigFiles(this MSB.Execution.
ProjectInstance
executedProject)
27
public static IEnumerable<MetadataReferenceItem> GetMetadataReferences(this MSB.Execution.
ProjectInstance
project)
38
public static string GetAbsolutePath(this MSB.Execution.
ProjectInstance
project, string path)
45
public static IEnumerable<ProjectFileReference> GetProjectReferences(this MSB.Execution.
ProjectInstance
executedProject)
50
public static PackageReferenceItem[] GetPackageReferences(this MSB.Execution.
ProjectInstance
executedProject)
89
public static string? ReadPropertyString(this MSB.Execution.
ProjectInstance
executedProject, string propertyName)
92
public static bool ReadPropertyBool(this MSB.Execution.
ProjectInstance
executedProject, string propertyName)
95
public static int ReadPropertyInt(this MSB.Execution.
ProjectInstance
executedProject, string propertyName)
98
public static int ReadCodePage(this MSB.Execution.
ProjectInstance
executedProject)
101
public static ulong ReadPropertyULong(this MSB.Execution.
ProjectInstance
executedProject, string propertyName)
104
public static TEnum? ReadPropertyEnum<TEnum>(this MSB.Execution.
ProjectInstance
executedProject, string propertyName, bool ignoreCase)
108
public static string ReadItemsAsString(this MSB.Execution.
ProjectInstance
executedProject, string itemType)
121
public static IEnumerable<MSB.Framework.ITaskItem> GetTaskItems(this MSB.Execution.
ProjectInstance
executedProject, string itemType)
MSBuild\ProjectFile\ProjectCommandLineReader.cs (2)
17
public abstract IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.
ProjectInstance
executedProject);
18
public abstract string[] ReadCommandLineArgs(MSB.Execution.
ProjectInstance
project);
MSBuild\ProjectFile\ProjectInstanceReader.cs (4)
18
public readonly MSB.Execution.
ProjectInstance
_projectInstance;
28
MSB.Execution.
ProjectInstance
projectInstance,
157
private static string[] GetContentFiles(MSB.Execution.
ProjectInstance
project)
166
private string[] TryGetCommandLineArgs(MSB.Execution.
ProjectInstance
project)
MSBuild\VisualBasic\VisualBasicCommandLineArgumentReader.cs (2)
13
public VisualBasicCommandLineArgumentReader(MSB.Execution.
ProjectInstance
project)
18
public static string[] Read(MSB.Execution.
ProjectInstance
project)
MSBuild\VisualBasic\VisualBasicProjectCommandLineReader.cs (2)
17
public override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.
ProjectInstance
executedProject)
20
public override string[] ReadCommandLineArgs(MSB.Execution.
ProjectInstance
project)
Microsoft.DotNet.HotReload.Watch (40)
Build\BuildRequest.cs (4)
9
internal readonly struct BuildRequest<T>(
ProjectInstance
projectInstance, ImmutableArray<string> targets, T data)
11
public
ProjectInstance
ProjectInstance { get; } = projectInstance;
18
public static BuildRequest<object?> Create(
ProjectInstance
instance, ImmutableArray<string> targets)
21
public static BuildRequest<T> Create<T>(
ProjectInstance
instance, ImmutableArray<string> targets, T data)
Build\BuildResult.cs (2)
8
internal readonly struct BuildResult<T>(IReadOnlyDictionary<string, TargetResult> targetResults,
ProjectInstance
projectInstance, T data)
11
public
ProjectInstance
ProjectInstance { get; } = projectInstance;
Build\EvaluationResult.cs (4)
15
IReadOnlyDictionary<ProjectInstanceId,
ProjectInstance
> restoredProjectInstances,
29
public IReadOnlyDictionary<ProjectInstanceId,
ProjectInstance
> RestoredProjectInstances
169
var
projectInstance = buildResult.ProjectInstance;
242
private static string[] GetBuildTargets(
ProjectInstance
projectInstance, bool suppressStaticWebAssets)
Build\ProjectBuildManager.cs (3)
36
Func<
ProjectInstance
, bool> onFailure,
73
var
projectInstance = (
ProjectInstance
)submission.AsyncContext!;
Build\ProjectGraphFactory.cs (2)
114
private
ProjectInstance
CreateProjectInstance(string projectPath, Dictionary<string, string> globalProperties, ProjectCollection projectCollection, string virtualProjectTargetFramework, ILogger logger)
129
var
projectInstance = VirtualProjectBuilder.CreateProjectInstance(
Build\ProjectGraphUtilities.cs (8)
19
public static string GetDisplayName(this
ProjectInstance
project)
22
public static string GetTargetFramework(this
ProjectInstance
project)
25
public static IReadOnlyList<string> GetTargetFrameworks(this
ProjectInstance
project)
58
public static string? GetOutputDirectory(this
ProjectInstance
project)
64
public static string? GetIntermediateOutputDirectory(this
ProjectInstance
project)
82
public static IReadOnlyList<string> GetStringListPropertyValue(this
ProjectInstance
project, string propertyName)
88
public static bool GetBooleanPropertyValue(this
ProjectInstance
project, string propertyName, bool defaultValue = false)
145
public static ProjectInstanceId GetId(this
ProjectInstance
project)
HotReload\CompilationHandler.cs (12)
32
/// Maps <see cref="
ProjectInstance
.FullPath"/> to the list of running instances of that project.
38
/// Maps <see cref="
ProjectInstance
.FullPath"/> to the list of active restart operations for the project.
56
/// Current set of project instances indexed by <see cref="
ProjectInstance
.FullPath"/>.
59
private ImmutableDictionary<string, ImmutableArray<
ProjectInstance
>> _projectInstances
60
= ImmutableDictionary<string, ImmutableArray<
ProjectInstance
>>.Empty.WithComparers(PathUtilities.OSSpecificPathComparer);
674
private static bool HasScopedCssTargets(
ProjectInstance
projectInstance)
687
var assets = new Dictionary<
ProjectInstance
, Dictionary<string, StaticWebAsset>>();
716
var
applicationProjectInstance = referencingProjectNode.ProjectInstance;
790
HashSet<
ProjectInstance
>? failedApplicationProjectInstances = null;
975
private static IEnumerable<RunningProject> GetCorrespondingRunningProjects(ImmutableDictionary<string, ImmutableArray<RunningProject>> runningProjects,
ProjectInstance
project)
986
private
ProjectInstance
GetProjectInstance(Project project)
1008
private static ImmutableDictionary<string, ImmutableArray<
ProjectInstance
>> CreateProjectInstanceMap(ProjectGraph graph)
HotReload\HotReloadDotNetWatcher.cs (5)
658
var
projectInstance = restoredProjectInstance.DeepCopy();
702
var
projectInstance = result.ProjectInstance;
1054
var
rootProject = projectGraph.Graph.GraphRoots.Single().ProjectInstance;
1184
ProjectInstance
rootProject,
1196
var
projectInstance = projectNode.ProjectInstance.DeepCopy();
Microsoft.DotNet.ProjectTools (10)
VirtualProjectBuilder.cs (10)
202
ProjectInstance
project,
257
internal ImmutableArray<(string Extension, string ItemType)> GetItemMapping(
ProjectInstance
project, ErrorReporter reportError)
265
public static
ProjectInstance
CreateProjectInstance(
276
out
var
projectInstance,
286
out
ProjectInstance
project,
300
(string ProjectFileText,
ProjectInstance
ProjectInstance, ProjectRootElement ProjectRootElement)? lastProject = null;
441
(
ProjectInstance
, ProjectRootElement) CreateProjectInstanceNoEvaluation(
474
var
project =
ProjectInstance
.FromProjectRootElement(projectRoot, new ProjectOptions
497
ProjectInstance
project,
MSBuild (2)
JsonOutputFormatter.cs (1)
46
internal void AddItemInstancesInJsonFormat(string[] itemNames,
ProjectInstance
project)
XMake.cs (1)
1153
ProjectInstance
builtProject = result.ProjectStateAfterBuild;
NuGet.Build.Tasks.Console (26)
MSBuildProjectInstance.cs (6)
15
/// Represents an <see cref="MSBuildItemBase" /> implementation which wraps a <see cref="
ProjectInstance
" /> object.
20
/// Gets the <see cref="
ProjectInstance
" /> being wrapped.
22
private readonly
ProjectInstance
_projectInstance;
27
/// <param name="projectInstance">The <see cref="
ProjectInstance
" /> to wrap.</param>
28
public MSBuildProjectInstance(
ProjectInstance
projectInstance)
43
public static implicit operator MSBuildProjectInstance(
ProjectInstance
projectInstance)
MSBuildStaticGraphRestore.cs (15)
256
/// <param name="project">The <see cref="
ProjectInstance
" /> to get framework references for.</param>
286
/// <param name="project">The <see cref="
ProjectInstance
" /> to get package downloads for.</param>
320
/// <param name="project">The <see cref="
ProjectInstance
" /> to get PackageVersion for.</param>
342
/// <param name="project">The <see cref="
ProjectInstance
" /> to get package references for.</param>
457
/// <param name="project">The <see cref="
ProjectInstance
" /> to get project references for.</param>
821
createProjectFactory: static (string projectPath, (
ProjectInstance
projectInstance, string targetFramework) args) =>
827
updateProjectFactory: static (string projectPath, RestoreProjectAdapter project, (
ProjectInstance
projectInstance, string targetFramework) args) =>
861
createProjectFactory: static (string projectPath, (
ProjectInstance
projectInstance, string targetFramework) args) =>
863
updateProjectFactory: static (string projectPath, ProjectWithInnerNodes project, (
ProjectInstance
projectInstance, string targetFramework) args) =>
945
Func<string, (
ProjectInstance
, string), TProject> createProjectFactory,
946
Func<string, TProject, (
ProjectInstance
, string), TProject> updateProjectFactory,
1231
Func<string, (
ProjectInstance
, string), TProject> createProjectFactory,
1232
Func<string, TProject, (
ProjectInstance
, string), TProject> updateProjectFactory,
1288
return
ProjectInstance
.FromFile(path, projectOptions);
1310
ProjectInstance
projectInstance = projectGraphItem.ProjectInstance;
ProjectWithInnerNodes.cs (3)
22
/// <param name="outerProject">The <see cref="
ProjectInstance
"/> of the outer project if any, otherwise <code>null</code>.</param>
29
/// Gets the <see cref="
ProjectInstance
"/> of the outer project.
38
/// <param name="project">The <see cref="
ProjectInstance
"/> of the project.</param>
TargetFrameworkAdapter.cs (2)
12
private
ProjectInstance
_projectInstance;
14
public TargetFrameworkAdapter(
ProjectInstance
projectInstance)
NuGet.CommandLine.XPlat (1)
Utility\MSBuildAPIUtility.cs (1)
934
var
newProject = new ProjectInstance(project.Xml, globalProperties, null, ProjectCollection.GlobalProjectCollection);