本文整理汇总了C#中SolutionItem.Build方法的典型用法代码示例。如果您正苦于以下问题:C# SolutionItem.Build方法的具体用法?C# SolutionItem.Build怎么用?C# SolutionItem.Build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolutionItem
的用法示例。
在下文中一共展示了SolutionItem.Build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PackageAddin
public static bool PackageAddin (SolutionItem item, Action<string> statusCallback, out string outputDirectory)
{
outputDirectory = "";
try
{
using (var monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ())
{
statusCallback("Building project...");
var buildResult = item.Build (monitor, IdeApp.Workspace.ActiveConfiguration);
if (buildResult.Failed == false)
{
statusCallback("Success!");
var project = item as Project;
var outputPath = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
outputDirectory = outputPath.ParentDirectory;
var command = String.Format (MDTOOL_PACK_COMMAND, outputPath, outputPath.ParentDirectory);
return ExecuteMDToolCommand (command, statusCallback);
}
else{
statusCallback("Building project failed...");
statusCallback(string.Join("\n\t", buildResult.Errors.Select(e => e.ErrorText)));
}
}
return false;
}
catch (Exception ex)
{
statusCallback("A critical error occurred while generating the mpack for the project." + ex.ToString ());
statusCallback ("Please file a bug report at https://github.com/matthew-ch-robbins/monodevelop-addin-packager");
}
return false;
}