19 instantiations of ProjectInstance
dotnet (2)
Commands\Reference\FileBasedAppReferenceEditor.cs (1)
234return new ProjectInstance(projectRootElement);
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
83var project = new ProjectInstance(projectFile, globalProperties, null);
Microsoft.Build (15)
BackEnd\BuildManager\BuildManager.cs (1)
2266return new ProjectInstance(
BackEnd\Shared\BuildRequestConfiguration.cs (1)
516return new ProjectInstance(
Construction\Solution\SolutionProjectGenerator.cs (2)
1042var traversalInstance = new ProjectInstance( 1279ProjectInstance metaprojectInstance = new ProjectInstance(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject));
Definition\Project.cs (1)
3758return new ProjectInstance(_data, DirectoryPath, FullPath, ProjectCollection.HostServices, ProjectCollection.EnvironmentProperties, settings);
Graph\ProjectGraph.cs (1)
988return new ProjectInstance(
Instance\ProjectInstance.cs (9)
206/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 931return new ProjectInstance( 951return new ProjectInstance( 972return new ProjectInstance(project, fastItemLookupNeeded); 1360/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 2211return new ProjectInstance(this, true, filter); 2227return new ProjectInstance(this, isImmutable); 2827return new ProjectInstance(translator); 3173ProjectInstance instance = new(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId);
Microsoft.DotNet.HotReload.Watch (1)
Build\ProjectGraphFactory.cs (1)
149return new ProjectInstance(
NuGet.CommandLine.XPlat (1)
Utility\MSBuildAPIUtility.cs (1)
937var newProject = new ProjectInstance(project.Xml, globalProperties, null, ProjectCollection.GlobalProjectCollection);
385 references to ProjectInstance
dotnet (82)
Commands\Project\Convert\ProjectConvertCommand.cs (5)
189var unwrapped = fileProjectInstance.Unwrap(); 425var outputProject = ProjectInstance.FromFile(projectFile, new ProjectOptions 467string? DetermineUserSecretsId(ProjectInstance projectInstance) 557IEnumerable<(string name, string value)> GetDefaultProperties(ProjectInstance projectInstance)
Commands\Reference\FileBasedAppReferenceEditor.cs (2)
16private readonly ProjectInstance _projectInstance; 230private static ProjectInstance CreateExpansionProjectInstance(string entryPointFilePath)
Commands\Reference\List\ReferenceListCommand.cs (2)
55ProjectInstance projectInstance = ProjectInstance.FromProjectRootElement(
Commands\Run\EnvironmentVariablesToMSBuild.cs (3)
26public static bool HasRuntimeEnvironmentVariableSupport(ProjectInstance projectInstance) 38public static void AddAsItems(ProjectInstance projectInstance, IReadOnlyDictionary<string, string> environmentVariables) 56public static IReadOnlyDictionary<string, string> ReadFromItems(ProjectInstance projectInstance)
Commands\Run\RunCommand.cs (11)
175Func<ProjectCollection, ProjectInstance>? projectFactory = null; 236internal ICommand GetTargetCommand(LaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, bool runPropertiesFromEvaluation, FacadeLogger? logger) 469private void EnsureProjectIsBuilt(out Func<ProjectCollection, ProjectInstance>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? projectBuilder, string? intermediateOutputPath, bool hasRuntimeEnvironmentVariableSupport) 565private ICommand GetTargetCommandForProject(ProjectLaunchProfile? launchSettings, Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties, bool runPropertiesFromEvaluation, FacadeLogger? logger) 588ProjectInstance project; 621static ProjectInstance EvaluateProject(string? projectFilePath, Func<ProjectCollection, ProjectInstance>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger) 641static void ValidatePreconditions(ProjectInstance project) 695static bool InvokeRunArgumentsTarget(ProjectInstance project, bool noBuild, FacadeLogger? binaryLogger, MSBuildArgs buildArgs, IReadOnlyDictionary<string, string> environmentVariables) 727internal static void ThrowUnableToRunError(ProjectInstance project) 1192var project = collection.LoadProject(ProjectFileFullPath).CreateProjectInstance();
Commands\Run\RunCommandSelector.cs (8)
59if (OpenProjectIfNeeded(out var projectInstance)) 76if (OpenProjectIfNeeded(out var projectInstance)) 132if (!OpenProjectIfNeeded(out var projectInstance)) 196private bool OpenProjectIfNeeded([NotNullWhen(true)] out ProjectInstance? projectInstance) 231private bool BuildTargets(ProjectInstance projectInstance, string[] targets, out IDictionary<string, TargetResult> targetOutputs) 255private ProjectInstance CreateRestoreProjectInstance() 366if (!OpenProjectIfNeeded(out var projectInstance)) 598if (!OpenProjectIfNeeded(out var projectInstance))
Commands\Run\RunProperties.cs (2)
23internal static bool TryFromProject(ProjectInstance project, [NotNullWhen(returnValue: true)] out RunProperties? result) 43internal static RunProperties FromProject(ProjectInstance project)
Commands\Run\RunTelemetry.cs (2)
193public static int CountPackageReferences(ProjectInstance project) 203public static int CountProjectReferences(ProjectInstance project)
Commands\Run\VirtualProjectBuildingCommand.cs (6)
287ProjectInstance? projectInstance = null; 509bool CanSaveCache(ProjectInstance projectInstance) 541void CollectAdditionalSources(CacheInfo cache, ProjectInstance projectInstance) 569void PrintBuildInformation(ProjectCollection projectCollection, ProjectInstance projectInstance, BuildResult? buildOrRestoreResult) 1181public ProjectInstance CreateProjectInstance(ProjectCollection projectCollection) 1187public ProjectInstance CreateProjectInstance(ProjectCollection projectCollection, IDictionary<string, string>? additionalGlobalProperties = null)
Commands\Solution\Add\SolutionAddCommand.cs (2)
182ProjectInstance projectInstance = ProjectInstance.FromProjectRootElement(
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (2)
330var projectInstance = ProjectInstance.FromFile(projectPath, new ProjectOptions
Commands\Test\MTP\MSBuildUtility.cs (2)
386var project = ProjectInstance.FromFile(filePath, new ProjectOptions
Commands\Test\MTP\SolutionAndProjectUtility.cs (9)
169private static ProjectInstance EvaluateProject( 243return ProjectInstance.FromFile(projectFilePath, new ProjectOptions 264ProjectInstance projectInstance = EvaluateProject(projectCollection, evaluationContext, projectFilePath, tfm: null, configuration, platform, additionalGlobalProperties); 367private static bool IsTraversalProject(ProjectInstance projectInstance) 386ProjectInstance projectInstance, 447var projectInstance = ProjectInstance.FromFile(projectFilePath, new ProjectOptions 550ProjectInstance project, 619ProjectInstance project,
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
83var project = new ProjectInstance(projectFile, globalProperties, null);
Extensions\ProjectInstanceExtensions.cs (7)
11public static string GetProjectId(this ProjectInstance projectInstance) 20public static string GetDefaultProjectTypeGuid(this ProjectInstance projectInstance) 30public static IEnumerable<string> GetPlatforms(this ProjectInstance projectInstance) 38public static IEnumerable<string> GetConfigurations(this ProjectInstance projectInstance) 52public static IEnumerable<string> GetRuntimeIdentifiers(this ProjectInstance projectInstance) 61public static IEnumerable<NuGetFramework> GetTargetFrameworks(this ProjectInstance projectInstance) 74public static IEnumerable<string> GetPropertyCommaSeparatedValues(this ProjectInstance projectInstance, string propertyName)
MsbuildProject.cs (4)
42private ProjectInstance _cachedEvaluatedProject; 149var project = GetEvaluatedProject(); 183private ProjectInstance GetEvaluatedProject() 215return _cachedEvaluatedProject = ProjectInstance.FromFile(ProjectRootElement.FullPath, options);
MSBuildSession.cs (5)
20/// <see cref="ProjectInstance.Build(string[], IEnumerable{ILogger})"/> runs a complete MSBuild build 86public bool Build(ProjectInstance project, string[] targets) 89/// <inheritdoc cref="Build(ProjectInstance, string[])"/> 92public bool Build(ProjectInstance project, string[] targets, out IDictionary<string, TargetResult> targetOutputs) 124/// Call this on the success path. Unlike <see cref="ProjectInstance.Build(string[], IEnumerable{ILogger})"/>,
ReleasePropertyProjectLocator.cs (9)
70ProjectInstance? project = GetTargetedProject(globalProperties, evaluationContext); 102public ProjectInstance? GetTargetedProject(ReadOnlyDictionary<string, string>? globalProps, EvaluationContext evaluationContext) 141public ProjectInstance? GetArbitraryProjectFromSolution(string slnPath, ReadOnlyDictionary<string, string>? globalProps, EvaluationContext evaluationContext) 159List<ProjectInstance> configuredProjects = []; 177var projectData = TryGetProjectInstance(projectFullPath, globalProps, evaluationContext); 211private ProjectInstance? GetSingleProjectFromSolution(SolutionModel sln, string slnPath, ReadOnlyDictionary<string, string>? globalProps, EvaluationContext evaluationContext) 221var projectData = TryGetProjectInstance(projectFullPath, globalProps, evaluationContext); 244private static ProjectInstance? TryGetProjectInstance(string projectPath, ReadOnlyDictionary<string, string>? globalProperties, EvaluationContext evaluationContext) 251return ProjectInstance.FromFile(projectPath, new ProjectOptions
dotnet-aot (11)
src\sdk\src\Cli\dotnet\Extensions\ProjectInstanceExtensions.cs (7)
11public static string GetProjectId(this ProjectInstance projectInstance) 20public static string GetDefaultProjectTypeGuid(this ProjectInstance projectInstance) 30public static IEnumerable<string> GetPlatforms(this ProjectInstance projectInstance) 38public static IEnumerable<string> GetConfigurations(this ProjectInstance projectInstance) 52public static IEnumerable<string> GetRuntimeIdentifiers(this ProjectInstance projectInstance) 61public static IEnumerable<NuGetFramework> GetTargetFrameworks(this ProjectInstance projectInstance) 74public static IEnumerable<string> GetPropertyCommaSeparatedValues(this ProjectInstance projectInstance, string propertyName)
src\sdk\src\Cli\dotnet\MsbuildProject.cs (4)
42private ProjectInstance _cachedEvaluatedProject; 149var project = GetEvaluatedProject(); 183private ProjectInstance GetEvaluatedProject() 215return _cachedEvaluatedProject = ProjectInstance.FromFile(ProjectRootElement.FullPath, options);
Microsoft.Build (174)
BackEnd\BuildManager\BuildManager.cs (6)
192private readonly Dictionary<ProjectInstance, string> _unnamedProjectInstanceToNames; 309_unnamedProjectInstanceToNames = new Dictionary<ProjectInstance, string>(); 990public ProjectInstance GetProjectInstanceForBuild(Project project) 1594ProjectInstance? projectInstance = submission.BuildRequestData.ProjectInstance; 1827var instances = ProjectInstance.LoadSolutionForBuild( 1872ProjectInstance newInstance = project.CreateProjectInstance();
BackEnd\BuildManager\BuildRequestData.cs (6)
22public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild) 33public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices) 45public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags) 58public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer) 92public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer, RequestedProjectState requestedProjectState) 172public ProjectInstance? ProjectInstance
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
177private IEnumerable<ProjectCacheDescriptor> GetProjectCacheDescriptors(ProjectInstance projectInstance)
BackEnd\Components\RequestBuilder\IntrinsicTask.cs (3)
24protected IntrinsicTask(TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs) 43internal ProjectInstance Project 66internal static IntrinsicTask InstantiateTask(ProjectTargetInstanceChild taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
42public ItemGroupIntrinsicTask(ProjectItemGroupTaskInstance taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\PropertyGroupIntrinsicTask.cs (1)
37public PropertyGroupIntrinsicTask(ProjectPropertyGroupTaskInstance taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
1500ProjectInstance project = _requestEntry?.RequestConfiguration?.Project; 1540ProjectInstance project = _requestEntry?.RequestConfiguration?.Project;
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
86private ProjectInstance _projectInstance;
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (2)
56internal TargetUpToDateChecker(ProjectInstance project, ProjectTargetInstance targetToAnalyze, ILoggingService loggingServices, BuildEventContext buildEventContext) 1234private ProjectInstance _project;
BackEnd\Shared\BuildRequestConfiguration.cs (8)
89private ProjectInstance _project; 94private ProjectInstance _transferredState; 226internal BuildRequestConfiguration(int configId, ProjectInstance instance) 406public ProjectInstance Project 441private void SetProjectBasedState(ProjectInstance project) 536private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile) 961translator.Translate(ref _transferredState, ProjectInstance.FactoryForDeserialization); 1005internal 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. 137private 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. 418public ProjectInstance? ProjectStateAfterBuild 649translator.Translate(ref _projectStateAfterBuild, ProjectInstance.FactoryForDeserialization);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (3)
93private ProjectInstance _projectInstance; 231public ProjectInstance ProjectInstance => _projectInstance; 278ProjectInstance projectInstance,
Construction\Solution\SolutionProjectGenerator.cs (35)
211internal static ProjectInstance[] Generate( 742private ProjectInstance[] Generate() 770private ProjectInstance[] CreateSolutionProject(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified) 798var projectInstances = new List<ProjectInstance>(projectsInOrder.Count + 1); 801ProjectInstance traversalInstance = CreateTraversalInstance(wrapperProjectToolsVersion, explicitToolsVersionSpecified, projectsInOrder); 830foreach (ProjectInstance instance in projectInstances) 841private void EvaluateAndAddProjects(List<ProjectInSolution> projectsInOrder, List<ProjectInstance> projectInstances, ProjectInstance traversalInstance, string selectedSolutionConfiguration) 876ProjectInstance metaproject = CreateMetaproject(traversalInstance, project, projectConfiguration); 891private void AddStandardTraversalTargets(ProjectInstance traversalInstance, List<ProjectInSolution> projectsInOrder) 907private ProjectInstance CreateTraversalInstance(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified, List<ProjectInSolution> projectsInOrder) 1042var traversalInstance = new ProjectInstance( 1120private void AddProjectReference(ProjectInstance traversalProject, ProjectInstance projectInstance, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration, bool direct) 1153private static string GetToolsVersionMetadataForDirectMSBuildTask(ProjectInstance traversalProject) 1170private static string GetPropertiesMetadataForProjectReference(ProjectInstance traversalProject, string configurationAndPlatformProperties) 1209private bool CanBuildDirectly(ProjectInstance traversalProject, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration) 1276private ProjectInstance CreateMetaproject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration) 1279ProjectInstance metaprojectInstance = new ProjectInstance(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject)); 1381private void AddMetaprojectReferenceItems(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project) 1409private static void AddMetaprojectTargetForManagedProject(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetName, string outputItem) 1428private static void AddProjectBuildTask(ProjectInstance traversalProject, ProjectConfigurationInSolution projectConfiguration, ProjectTargetInstance target, string targetToBuild, string sourceItems, string condition, string outputItem) 1927private void AddMetaprojectTargetForUnknownProjectType(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project, string targetName, string unknownProjectTypeErrorMessage) 1997private void AddValidateProjectsTarget(ProjectInstance traversalProject, List<ProjectInSolution> projects) 2039private static void AddTraversalReferencesTarget(ProjectInstance traversalProject, string targetName, string outputItem, bool batchBuildTargets) 2091private void AddTraversalTargetForProject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetToBuild, string outputItem, bool canBuildDirectly) 2136private IDictionary<string, string> GetMetaprojectGlobalProperties(ProjectInstance traversalProject) 2410private void AddInitialTargets(ProjectInstance traversalProject, List<ProjectInSolution> projects) 2421private void AddValidateSolutionConfigurationTarget(ProjectInstance traversalProject) 2456private static void AddValidateToolsVersionsTarget(ProjectInstance traversalProject) 2469private static void AddGetSolutionConfigurationContentsTarget(ProjectInstance traversalProject)
Definition\Project.cs (7)
556/// evaluation via <see cref="ProjectOptions.EvaluationStage"/>; use <see cref="ProjectInstance"/> 1385public ProjectInstance CreateProjectInstance() 1399public ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings) 1410public ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 3323public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 3392ProjectInstance instance = CreateProjectInstance(LoggingService, ProjectInstanceSettings.None, evaluationContext); 3751private ProjectInstance CreateProjectInstance(
Definition\ProjectOptions.cs (1)
63/// <see cref="Microsoft.Build.Execution.ProjectInstance"/>; passing a partial stage to a <see cref="Project"/> factory
Graph\GraphBuilder.cs (4)
55private ConcurrentDictionary<ConfigurationMetadata, Lazy<ProjectInstance>> _platformNegotiationInstancesCache = new(); 540ProjectInstance projectInstance; 643private ProjectInstance GetInstanceForPlatformNegotiationWithCaching( 650new 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> 55public 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 968internal ProjectInstance DefaultProjectInstanceFactory( 982internal static ProjectInstance StaticProjectInstanceFactory(
Graph\ProjectGraphNode.cs (2)
25internal ProjectGraphNode(ProjectInstance projectInstance) 46public ProjectInstance ProjectInstance { get; }
Graph\ProjectInterpretation.cs (10)
80ProjectInstance requesterInstance = projectGraphNode.ProjectInstance; 178var projectInstance = projectInstanceFactory( 203var projectInstanceForDiscovery = projectInstanceFactory( 251internal static string GetInnerBuildPropertyValue(ProjectInstance project) 256internal static string GetInnerBuildPropertyName(ProjectInstance project) 261internal static string GetInnerBuildPropertyValues(ProjectInstance project) 266internal static ProjectType GetProjectType(ProjectInstance project) 321private static IEnumerable<ProjectItemInstance> ConstructInnerBuildReferences(ProjectInstance outerBuild) 550public static TargetsToPropagate FromProjectAndEntryTargets(ProjectInstance project, string[] entryTargets) 637ProjectInstance projectInstance = projectGraphNode.ProjectInstance;
Instance\ProjectInstance.cs (29)
206/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 432/// The resulting <see cref="ProjectInstance"/> object wraps the <see cref="Project"/> 574internal ProjectInstance(string projectFile, ProjectInstance projectToInheritFrom, IDictionary<string, string> globalProperties) 637/// Initializes a new instance of the <see cref="ProjectInstance"/> class directly. 750private ProjectInstance(ProjectInstance that, bool isImmutable, RequestedProjectState filter = null) 929public static ProjectInstance FromFile(string file, ProjectOptions options) 949public static ProjectInstance FromProjectRootElement(ProjectRootElement rootElement, ProjectOptions options) 969public static ProjectInstance FromImmutableProjectSource(Project project, ProjectInstanceSettings settings) 993ProjectInstance owningProjectInstance) 1015ProjectInstance owningProjectInstance, 1360/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 1440/// Adds an Environment Variable that was resolved by an <see cref="SdkResolver"/> to the set of properties tracked by this <see cref="ProjectInstance"/>. 2194public ProjectInstance DeepCopy() 2209public ProjectInstance FilteredCopy(RequestedProjectState filter) 2219public ProjectInstance DeepCopy(bool isImmutable) 2485/// from the <see cref="ProjectInstance"/> provided. 2487/// <param name="projectState"><see cref="ProjectInstance"/> with the state to use.</param> 2488public void UpdateStateFrom(ProjectInstance projectState) 2505Assumed.NotNull(TaskRegistry, $"{nameof(TaskRegistry)} Cannot be null after {nameof(ProjectInstance)} object creation."); 2686internal static ProjectInstance[] LoadSolutionForBuild( 2704ProjectInstance[] projectInstances = null; 2751private static ProjectInstance[] CalculateToolsVersionAndGenerateSolutionWrapper( 2777ProjectInstance[] projectInstances = null; 2825internal static ProjectInstance FactoryForDeserialization(ITranslator translator) 3045private static ProjectInstance[] GenerateSolutionWrapper( 3071ProjectInstance[] instances = SolutionProjectGenerator.Generate(sp, globalProperties, toolsVersion, projectBuildEventContext, loggingService, targetNames, sdkResolverService, submissionId); 3099private static ProjectInstance[] GenerateSolutionWrapperUsingOldOM( 3173ProjectInstance instance = new(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId); 3559ProjectInstance projectInstance,
Instance\ProjectItemInstance.cs (30)
49private ProjectInstance _project; 70internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, string definingFileEscaped) 82internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, string includeBeforeWildcardExpansionEscaped, string definingFileEscaped) 101ProjectInstance project, 124internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, IEnumerable<KeyValuePair<string, string>> directMetadata, string definingFileEscaped) 148private ProjectItemInstance(ProjectItemInstance that, ProjectInstance newProject) 158private ProjectItemInstance(ProjectInstance projectInstance) 169public ProjectInstance Project 638internal static ProjectItemInstance FactoryForDeserialization(ITranslator translator, ProjectInstance projectInstance) 696internal ProjectItemInstance DeepClone(ProjectInstance newProject) 728ProjectInstance projectToUse, 933ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 959ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1056ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1154ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1173ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1462ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1473ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1484ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1530ProjectInstance.VerifyThrowNotImmutable(destinationAsTaskItem._isImmutable); 1845ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1966ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1983ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2004ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2023ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2034ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2049ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2211private ProjectInstance _project; 2218internal ProjectItemInstanceFactory(ProjectInstance project) 2226internal ProjectItemInstanceFactory(ProjectInstance project, string itemType)
Instance\ProjectPropertyInstance.cs (1)
76ProjectInstance.VerifyThrowNotImmutable(IsImmutable);
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (1)
235public abstract ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (1)
32public HotReloadMSBuildWorkspace(ILogger logger, Func<string, (ImmutableArray<MSB.Execution.ProjectInstance> instances, MSB.Evaluation.Project? project)> getBuildProjects)
Api\HotReloadMSBuildWorkspace.ProjectFileInfoProvider.cs (1)
18Func<string, (ImmutableArray<MSB.Execution.ProjectInstance> instances, MSB.Evaluation.Project? project)> getBuildProjects,
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (42)
Build\ProjectBuildManager.cs (9)
205public (MSB.Execution.ProjectInstance? projectInstance, DiagnosticLog log) LoadProjectInstance(string path, TextReader content, IDictionary<string, string>? additionalGlobalProperties) 226var projectInstance = MSB.Execution.ProjectInstance.FromProjectRootElement(projectRootElement, new MSB.Definition.ProjectOptions 263public async Task<MSB.Execution.ProjectInstance[]> BuildProjectInstancesAsync( 285var results = new List<MSB.Execution.ProjectInstance>(targetFrameworks.Length); 291var projectInstance = await BuildProjectInstanceAsync(project, log, cancellationToken).ConfigureAwait(false); 309private Task<MSB.Execution.ProjectInstance> BuildProjectInstanceAsync( 318private async Task<MSB.Execution.ProjectInstance> BuildProjectInstanceAsync( 323var projectInstance = project.CreateProjectInstance();
MSBuild\CSharp\CSharpCommandLineArgumentReader.cs (2)
11private CSharpCommandLineArgumentReader(MSB.Execution.ProjectInstance project) 16public static string[] Read(MSB.Execution.ProjectInstance project)
MSBuild\CSharp\CSharpProjectCommandLineReader.cs (2)
17public override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject) 20public override string[] ReadCommandLineArgs(MSB.Execution.ProjectInstance project)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (2)
15protected readonly MSB.Execution.ProjectInstance Project; 18protected CommandLineArgumentReader(MSB.Execution.ProjectInstance project)
MSBuild\ProjectFile\Extensions.cs (16)
15public static IEnumerable<MSB.Framework.ITaskItem> GetAdditionalFiles(this MSB.Execution.ProjectInstance executedProject) 18public static IEnumerable<MSB.Framework.ITaskItem> GetAnalyzers(this MSB.Execution.ProjectInstance executedProject) 21public static IEnumerable<MSB.Framework.ITaskItem> GetDocuments(this MSB.Execution.ProjectInstance executedProject) 24public static IEnumerable<MSB.Framework.ITaskItem> GetEditorConfigFiles(this MSB.Execution.ProjectInstance executedProject) 27public static IEnumerable<MetadataReferenceItem> GetMetadataReferences(this MSB.Execution.ProjectInstance project) 38public static string GetAbsolutePath(this MSB.Execution.ProjectInstance project, string path) 45public static IEnumerable<ProjectFileReference> GetProjectReferences(this MSB.Execution.ProjectInstance executedProject) 50public static PackageReferenceItem[] GetPackageReferences(this MSB.Execution.ProjectInstance executedProject) 95public static string? ReadPropertyString(this MSB.Execution.ProjectInstance executedProject, string propertyName) 98public static bool ReadPropertyBool(this MSB.Execution.ProjectInstance executedProject, string propertyName) 101public static int ReadPropertyInt(this MSB.Execution.ProjectInstance executedProject, string propertyName) 104public static int ReadCodePage(this MSB.Execution.ProjectInstance executedProject) 107public static ulong ReadPropertyULong(this MSB.Execution.ProjectInstance executedProject, string propertyName) 110public static TEnum? ReadPropertyEnum<TEnum>(this MSB.Execution.ProjectInstance executedProject, string propertyName, bool ignoreCase) 114public static string ReadItemsAsString(this MSB.Execution.ProjectInstance executedProject, string itemType) 127public static IEnumerable<MSB.Framework.ITaskItem> GetTaskItems(this MSB.Execution.ProjectInstance executedProject, string itemType)
MSBuild\ProjectFile\ProjectCommandLineReader.cs (2)
17public abstract IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject); 18public abstract string[] ReadCommandLineArgs(MSB.Execution.ProjectInstance project);
MSBuild\ProjectFile\ProjectInstance.cs (1)
13MSB.Execution.ProjectInstance? projectInstance,
MSBuild\ProjectFile\ProjectInstanceReader.cs (4)
18public readonly MSB.Execution.ProjectInstance _projectInstance; 31MSB.Execution.ProjectInstance projectInstance, 161private static string[] GetContentFiles(MSB.Execution.ProjectInstance project) 170private string[] TryGetCommandLineArgs(MSB.Execution.ProjectInstance project)
MSBuild\VisualBasic\VisualBasicCommandLineArgumentReader.cs (2)
13public VisualBasicCommandLineArgumentReader(MSB.Execution.ProjectInstance project) 18public static string[] Read(MSB.Execution.ProjectInstance project)
MSBuild\VisualBasic\VisualBasicProjectCommandLineReader.cs (2)
17public override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject) 20public override string[] ReadCommandLineArgs(MSB.Execution.ProjectInstance project)
Microsoft.DotNet.HotReload.Watch (37)
Build\BuildRequest.cs (4)
9internal readonly struct BuildRequest<T>(ProjectInstance projectInstance, ImmutableArray<string> targets, T data) 11public ProjectInstance ProjectInstance { get; } = projectInstance; 18public static BuildRequest<object?> Create(ProjectInstance instance, ImmutableArray<string> targets) 21public static BuildRequest<T> Create<T>(ProjectInstance instance, ImmutableArray<string> targets, T data)
Build\BuildResult.cs (2)
8internal readonly struct BuildResult<T>(IReadOnlyDictionary<string, TargetResult> targetResults, ProjectInstance projectInstance, T data) 11public ProjectInstance ProjectInstance { get; } = projectInstance;
Build\EvaluationResult.cs (4)
15IReadOnlyDictionary<ProjectInstanceId, ProjectInstance> restoredProjectInstances, 29public IReadOnlyDictionary<ProjectInstanceId, ProjectInstance> RestoredProjectInstances 169var projectInstance = buildResult.ProjectInstance; 238private static string[] GetBuildTargets(ProjectInstance projectInstance, bool suppressStaticWebAssets)
Build\ProjectBuildManager.cs (3)
36Func<ProjectInstance, bool> onFailure, 73var projectInstance = (ProjectInstance)submission.AsyncContext!;
Build\ProjectGraphFactory.cs (1)
115private ProjectInstance CreateProjectInstance(string projectPath, Dictionary<string, string> globalProperties, ProjectCollection projectCollection, string virtualProjectTargetFramework, ILogger logger)
Build\ProjectGraphUtilities.cs (9)
19public static string GetDisplayName(this ProjectInstance project) 22public static string GetTargetFramework(this ProjectInstance project) 25public static IReadOnlyList<string> GetTargetFrameworks(this ProjectInstance project) 58public static string? GetOutputDirectory(this ProjectInstance project) 61public static string GetAssemblyName(this ProjectInstance project) 67public static string? GetIntermediateOutputDirectory(this ProjectInstance project) 86public static IReadOnlyList<string> GetStringListPropertyValue(this ProjectInstance project, string propertyName) 92public static bool GetBooleanPropertyValue(this ProjectInstance project, string propertyName, bool defaultValue = false) 149public static ProjectInstanceId GetId(this ProjectInstance project)
HotReload\HotReloadDotNetWatcher.cs (5)
673var projectInstance = restoredProjectInstance.DeepCopy(); 717var projectInstance = result.ProjectInstance; 1069var rootProject = projectGraph.Graph.GraphRoots.Single().ProjectInstance; 1199ProjectInstance rootProject, 1211var projectInstance = projectNode.ProjectInstance.DeepCopy();
HotReload\ManagedCodeSnapshot.cs (1)
13public ImmutableDictionary<string, ImmutableArray<ProjectInstance>> ProjectInstances { get; init; }
HotReload\ManagedCodeWorkspace.cs (4)
23/// Current set of project instances indexed by <see cref="ProjectInstance.FullPath"/>. 26private ImmutableDictionary<string, ImmutableArray<ProjectInstance>> _projectInstances 27= ImmutableDictionary<string, ImmutableArray<ProjectInstance>>.Empty.WithComparers(PathUtilities.OSSpecificPathComparer); 94private static ImmutableDictionary<string, ImmutableArray<ProjectInstance>> CreateProjectInstanceMap(ProjectGraph graph)
HotReload\ProjectUpdatesBuilder.cs (1)
204private ProjectInstance GetProjectInstance(Project project)
HotReload\ProjectUpdatesBuilder.StaticWebAssets.cs (1)
42private static bool HasScopedCssTargets(ProjectInstance projectInstance)
HotReload\RunningProjectsManager.cs (2)
28/// Maps <see cref="ProjectInstance.FullPath"/> to the list of running instances of that project. 34/// Maps <see cref="ProjectInstance.FullPath"/> to the list of active restart operations for the project.
Microsoft.DotNet.ProjectTools (5)
BuildService.cs (5)
43extension(Microsoft.Build.Execution.ProjectInstance projectInstance) 61public Microsoft.Build.Execution.ProjectInstance Unwrap() 88sealed file class ProjectInstance(Microsoft.Build.Execution.ProjectInstance inner) : IProjectInstance 105return new(Microsoft.Build.Execution.ProjectInstance.FromProjectRootElement(projectRoot.Inner, new() 112public Microsoft.Build.Execution.ProjectInstance Inner => inner;
MSBuild (5)
JsonOutputFormatter.cs (1)
45internal void AddItemInstancesInJsonFormat(string[] itemNames, ProjectInstance project)
XMake.cs (4)
1068ProjectInstance project = ProjectInstance.FromFile(projectFile, new ProjectOptions 1381private static ExitType OutputPropertiesAfterEvaluation(string[] getProperty, string[] getItem, ProjectInstance project, TextWriter outputStream) 1403ProjectInstance 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. 22private readonly ProjectInstance _projectInstance; 27/// <param name="projectInstance">The <see cref="ProjectInstance" /> to wrap.</param> 28public MSBuildProjectInstance(ProjectInstance projectInstance) 43public static implicit operator MSBuildProjectInstance(ProjectInstance projectInstance)
MSBuildStaticGraphRestore.cs (15)
263/// <param name="project">The <see cref="ProjectInstance" /> to get framework references for.</param> 293/// <param name="project">The <see cref="ProjectInstance" /> to get package downloads for.</param> 327/// <param name="project">The <see cref="ProjectInstance" /> to get PackageVersion for.</param> 349/// <param name="project">The <see cref="ProjectInstance" /> to get package references for.</param> 464/// <param name="project">The <see cref="ProjectInstance" /> to get project references for.</param> 831createProjectFactory: static (string projectPath, (ProjectInstance projectInstance, string targetFramework) args) => 837updateProjectFactory: static (string projectPath, RestoreProjectAdapter project, (ProjectInstance projectInstance, string targetFramework) args) => 871createProjectFactory: static (string projectPath, (ProjectInstance projectInstance, string targetFramework) args) => 873updateProjectFactory: static (string projectPath, ProjectWithInnerNodes project, (ProjectInstance projectInstance, string targetFramework) args) => 958Func<string, (ProjectInstance, string), TProject> createProjectFactory, 959Func<string, TProject, (ProjectInstance, string), TProject> updateProjectFactory, 1261Func<string, (ProjectInstance, string), TProject> createProjectFactory, 1262Func<string, TProject, (ProjectInstance, string), TProject> updateProjectFactory, 1318return ProjectInstance.FromFile(path, projectOptions); 1340ProjectInstance 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)
14private ProjectInstance _projectInstance; 16public TargetFrameworkAdapter(ProjectInstance projectInstance)
NuGet.CommandLine.XPlat (1)
Utility\MSBuildAPIUtility.cs (1)
937var newProject = new ProjectInstance(project.Xml, globalProperties, null, ProjectCollection.GlobalProjectCollection);