Microsoft.Build.BuildEngine.Engine.GetLoadedProject C# (CSharp) Method

GetLoadedProject() public method

public GetLoadedProject ( string projectFullFileName ) : Microsoft.Build.BuildEngine.Project
projectFullFileName string
return Microsoft.Build.BuildEngine.Project
		public Project GetLoadedProject (string projectFullFileName)
		{
			if (projectFullFileName == null)
				throw new ArgumentNullException ("projectFullFileName");
			
			Project project;
			projects.TryGetValue (projectFullFileName, out project);

			return project;
		}

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the in memory project. Sets BuildEnabled on the project to true.
        /// </summary>
        /// <param name="engine">The build engine to use to create a build project.</param>
        /// <param name="fullProjectPath">The full path of the project.</param>
        /// <returns>A loaded msbuild project.</returns>
        internal static MSBuild.Project InitializeMsBuildProject(MSBuild.Engine buildEngine, string fullProjectPath)
        {
            if (buildEngine == null)
            {
                throw new ArgumentNullException("engine");
            }

            if (String.IsNullOrEmpty(fullProjectPath))
            {
                throw new ArgumentException(SR.GetString(SR.InvalidParameter), "fullProjectPath");
            }

            // Check if the project already has been loaded with the fullProjectPath. If yes return the build project associated to it.
            MSBuild.Project buildProject = buildEngine.GetLoadedProject(fullProjectPath);

            if (buildProject == null)
            {
                buildProject = buildEngine.CreateNewProject();
                buildProject.BuildEnabled = true;
                buildProject.Load(fullProjectPath);
            }

            return(buildProject);
        }
All Usage Examples Of Microsoft.Build.BuildEngine.Engine::GetLoadedProject