本文整理汇总了C#中Microsoft.SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.SetProperty方法的具体用法?C# Microsoft.SetProperty怎么用?C# Microsoft.SetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.SetProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
public override void Generate(ProjectType projectType, Microsoft.Build.Evaluation.Project project) {
project.SetProperty(Name, Value + projectType.CodeExtension);
}
示例2: ResolveAssemblyReferences
private IEnumerable<string> ResolveAssemblyReferences(Microsoft.Build.Evaluation.Project project)
{
var projectInstance = project.CreateProjectInstance();
projectInstance.SetProperty("BuildingProject", "false");
project.SetProperty("DesignTimeBuild", "true");
projectInstance.Build("ResolveAssemblyReferences", new[] { new ConsoleLogger(LoggerVerbosity.Minimal) });
var items = projectInstance.GetItems("_ResolveAssemblyReferenceResolvedFiles");
return items.Select(i => Path.Combine(Path.GetDirectoryName(this.FileName), i.GetMetadataValue("Identity")));
}
示例3: SetTreatLevel
private static void SetTreatLevel(Microsoft.Build.BuildEngine.Project project, BuildIntegration buildIntegration)
{
Param.AssertNotNull(project, "project");
Param.AssertNotNull(buildIntegration, "enable");
switch (buildIntegration)
{
case BuildIntegration.None:
break;
case BuildIntegration.TreatErrorAsWarning:
project.SetProperty(StyleCopTreatErrorsAsWarnings, true.ToString(), string.Empty);
break;
case BuildIntegration.TreatErrorAsError:
project.SetProperty(StyleCopTreatErrorsAsWarnings, false.ToString(), string.Empty);
break;
default:
throw new ArgumentOutOfRangeException("buildIntegration");
}
}
示例4: SetWarehouseVersion
public void SetWarehouseVersion(Microsoft.TeamFoundation.Warehouse.WarehouseDataAccessComponent dac)
{
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
dac.SetProperty(null, VersionPropertyBagKey, assemblyVersion.ToString());
}
示例5: ResolveAssemblyReferences
IEnumerable<string> ResolveAssemblyReferences(Microsoft.Build.Evaluation.Project project)
{
// Use MSBuild to figure out the full path of the referenced assemblies
var projectInstance = project.CreateProjectInstance();
projectInstance.SetProperty("BuildingProject", "false");
project.SetProperty("DesignTimeBuild", "true");
projectInstance.Build("ResolveAssemblyReferences", new [] { new ConsoleLogger(LoggerVerbosity.Minimal) });
var items = projectInstance.GetItems("_ResolveAssemblyReferenceResolvedFiles");
string baseDirectory = Path.GetDirectoryName(this.FileName);
var result = items.Select(i => Path.Combine(baseDirectory, i.GetMetadataValue("Identity"))).ToList();
if (!result.Any(t => t.Contains("mscorlib") || t.Contains("System.Runtime")))
result.Add(typeof(object).Assembly.Location);
return result;
}