本文整理汇总了C#中Microsoft.Build.BuildEngine.Project.ResetBuildStatus方法的典型用法代码示例。如果您正苦于以下问题:C# Project.ResetBuildStatus方法的具体用法?C# Project.ResetBuildStatus怎么用?C# Project.ResetBuildStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.Project
的用法示例。
在下文中一共展示了Project.ResetBuildStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResetBuildVirtualPropertyReset
public void ResetBuildVirtualPropertyReset()
{
Project p = new Project(new Engine());
p.LoadXml(TestData.ContentCreatePropertyTarget);
p.SetProperty("p", "v1");
p.Build("CreatePropertyTarget");
Assertion.AssertEquals("v", p.GetEvaluatedProperty("p"));
p.ResetBuildStatus();
Assertion.AssertEquals("v1", p.GetEvaluatedProperty("p"));
}
示例2: StartRootProjectBuild
/// <summary>
/// Engine.BuildProject gets called recursively when projects use the
/// MSBuild *task* to build other child projects. If "numberOfProjectsInProgress"
/// is 0, then we know we are currently NOT in a recursive call. We
/// are really being called at the top level.
/// </summary>
private void StartRootProjectBuild(BuildRequest buildRequest, Project project)
{
foreach (Project loadedProject in projectsLoadedByHost.Values)
{
// There should be no projects in the ProjectManager with the same full path, global properties and tools version
// as any of the loaded projects. If there are, something went badly awry, because
// we were supposed to have deleted them after the last build.
ErrorUtilities.VerifyThrow(null == this.cacheOfBuildingProjects.GetProject(loadedProject.FullFileName, loadedProject.GlobalProperties, loadedProject.ToolsVersion),
"Project shouldn't be in ProjectManager already.");
// Add the loaded project to the list of projects being built, just
// so that during the build, we have only one place we need to look
// instead of having to search multiple lists.
this.cacheOfBuildingProjects.AddProject(loadedProject);
}
if (0 == (buildRequest.BuildSettings & BuildSettings.DoNotResetPreviouslyBuiltTargets))
{
// Reset the build state for all projects that are still cached from the
// last build and the currently loaded projects that we just added to
// the ProjectManager.
this.cacheOfBuildingProjects.ResetBuildStatusForAllProjects();
// Clear the project build results cache
this.cacheManager.ClearCache();
// Reset the build state for the project that we're going to build. This may not
// be in the ProjectManager if it doesn't have a FullFileName property.
project.ResetBuildStatus();
}
}
示例3: ResetBuildVirtualItemReset
public void ResetBuildVirtualItemReset()
{
Project p = new Project(new Engine());
p.LoadXml(TestData.ContentCreateItemTarget);
p.AddNewItem("BuildItem", "i1");
p.Build("CreateItemTarget");
Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include);
Assertion.AssertEquals("i", p.EvaluatedItems[1].Include);
int preCount = p.EvaluatedItems.Count;
p.ResetBuildStatus();
Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include);
Assertion.AssertEquals(preCount - 1, p.EvaluatedItems.Count);
}