本文整理汇总了C#中Microsoft.Build.BuildEngine.Engine.BuildProjectFile方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.BuildProjectFile方法的具体用法?C# Engine.BuildProjectFile怎么用?C# Engine.BuildProjectFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.Engine
的用法示例。
在下文中一共展示了Engine.BuildProjectFile方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildProjects
public bool BuildProjects(List<IProject> projects)
{
var engine = new Engine();
foreach (IProject project in projects)
{
string fullProjectPath = Path.Combine(project.ProjectPath, project.ProjectName);
bool success = engine.BuildProjectFile(fullProjectPath);
if (success == false)
return false;
}
return true;
}
示例2: BuildProject
public static bool BuildProject(string projectPath)
{
bool success = false;
CultureInfo ci = CultureInfo.InvariantCulture;
Engine engine = new Engine();
engine.BinPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.System)
+ @"\..\Microsoft.NET\Framework\v4.0.30319";
try
{
success = engine.BuildProjectFile(projectPath);
}
finally
{
engine.UnloadAllProjects();
}
return success;
}
示例3: BuildProject
public bool BuildProject(string projectPath)
{
bool success = false;
CultureInfo ci = CultureInfo.InvariantCulture;
Engine engine = new Engine();
engine.BinPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.System)
+ @"\..\Microsoft.NET\Framework\v4.0.30319";
try
{
success = engine.BuildProjectFile(projectPath);
}
catch(ArgumentException)
{
throw new System.IO.FileNotFoundException("The specified project to build not found!");
}
finally
{
engine.UnloadAllProjects();
}
return success;
}
示例4: Main
static void Main(string[] args)
{
// We need to tell MSBuild where msbuild.exe is, so it can launch child nodes
string parameters = @"MSBUILDLOCATION=" + System.Environment.GetFolderPath(System.Environment.SpecialFolder.System) + @"\..\Microsoft.NET\Framework\v3.5";
// We need to tell MSBuild whether nodes should hang around for 60 seconds after the build is done in case they are needed again
bool nodeReuse = true; // e.g.
if (!nodeReuse)
{
parameters += ";NODEREUSE=false";
}
// We need to tell MSBuild the maximum number of nodes to use. It is usually fastest to pick about the same number as you have CPU cores
int maxNodeCount = 3; // e.g.
// Create the engine with this information
Engine buildEngine = new Engine(null, ToolsetDefinitionLocations.Registry | ToolsetDefinitionLocations.ConfigurationFile, maxNodeCount, parameters);
// Create a file logger with a matching forwarding logger, e.g.
FileLogger fileLogger = new FileLogger();
fileLogger.Verbosity = LoggerVerbosity.Detailed;
Assembly engineAssembly = Assembly.GetAssembly(typeof(Engine));
string loggerAssemblyName = engineAssembly.GetName().FullName;
LoggerDescription fileLoggerForwardingLoggerDescription = new LoggerDescription("Microsoft.Build.BuildEngine.ConfigurableForwardingLogger", loggerAssemblyName, null, String.Empty, LoggerVerbosity.Detailed);
// Create a regular console logger too, e.g.
ConsoleLogger logger = new ConsoleLogger();
logger.Verbosity = LoggerVerbosity.Normal;
// Register all of these loggers
buildEngine.RegisterDistributedLogger(fileLogger, fileLoggerForwardingLoggerDescription);
buildEngine.RegisterLogger(logger);
// Do a build
buildEngine.BuildProjectFile("root.proj");
// Finish cleanly
buildEngine.Shutdown();
}
示例5: BuildProjectFilesInParallel2
public void BuildProjectFilesInParallel2()
{
string[] fileNames = new string[10];
string[] fileNames2 = new string[10];
string[] fileNamesLeafs = new string[10];
string[] childTraversals = new string[10];
string parentTraversal = TraversalProjectFile("CTrav");
string traversalProject = TraversalProjectFile("ABC");
string[][] targetNamesPerProject = new string[fileNames.Length][];
IDictionary[] targetOutPutsPerProject = new IDictionary[fileNames.Length];
BuildPropertyGroup[] globalPropertiesPerProject = new BuildPropertyGroup[fileNames.Length];
string[] tempfilesToDelete = new string[fileNames.Length];
string[] tempfilesToDelete2 = new string[fileNames.Length];
string[] tempfilesToDelete3 = new string[fileNames.Length];
string[] tempfilesToDelete4 = new string[fileNames.Length];
Engine engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
try
{
for (int i = 0; i < fileNames.Length; i++)
{
string[] ProjectFiles1 = CreateGlobalPropertyProjectFileWithExtension("ABC");
string[] ProjectFiles2 = CreateGlobalPropertyProjectFileWithExtension("DEF");
string[] FileNamesLeafs = CreateGlobalPropertyProjectFileWithExtension("LEAF");
string[] ChildTraversals = CreateSingleProjectTraversalFileWithExtension(FileNamesLeafs[0],"CTrav");
fileNames[i] = ProjectFiles1[0];
fileNames2[i] = ProjectFiles2[0];
fileNamesLeafs[i] = FileNamesLeafs[0];
childTraversals[i] = ChildTraversals[0];
tempfilesToDelete[i] = ProjectFiles1[1];
tempfilesToDelete2[i] = ProjectFiles2[1];
tempfilesToDelete3[i] = FileNamesLeafs[1];
tempfilesToDelete4[i] = ChildTraversals[1];
targetNamesPerProject[i] = new string[] { "Build" };
}
// Try building a traversal project that had other traversals
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFile(parentTraversal, new string[] { "Build" }, new BuildPropertyGroup(), null, BuildSettings.None, "3.5");
engine.Shutdown();
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
// Try building the same traversal project on the same engine one after another
engine.BuildProjectFile(traversalProject);
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
// Try building the same set of project files on the same engine one after another
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.Shutdown();
// Try building a set of project files, then the same set as a traversal on the same engine
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
// Try building a traversal, then the same files which are in the traversal in parallel on the same engine
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFile(traversalProject);
engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.Shutdown();
/* Do the same as above using single proc */
// Try building the same traversal project on the same engine one after another
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFile(traversalProject);
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
// Try building the same set of project files on the same engine one after another
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.Shutdown();
// Try building a set of project files, then the same set as a traversal on the same engine
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
// Try building a traversal, then the same files which are in the traversal in parallel on the same engine
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
//.........这里部分代码省略.........
示例6: BuildProjectFilesInParallel
public void BuildProjectFilesInParallel()
{
//Gets the currently loaded assembly in which the specified class is defined
Assembly engineAssembly = Assembly.GetAssembly(typeof(Engine));
string loggerClassName = "Microsoft.Build.BuildEngine.ConfigurableForwardingLogger";
string loggerAssemblyName = engineAssembly.GetName().FullName;
LoggerDescription forwardingLoggerDescription = new LoggerDescription(loggerClassName, loggerAssemblyName, null, null, LoggerVerbosity.Normal);
string[] fileNames = new string[10];
string traversalProject = TraversalProjectFile("ABC");
string[][] targetNamesPerProject = new string[fileNames.Length][];
IDictionary[] targetOutPutsPerProject = new IDictionary[fileNames.Length];
BuildPropertyGroup[] globalPropertiesPerProject = new BuildPropertyGroup[fileNames.Length];
string[] tempfilesToDelete = new string[fileNames.Length];
Engine engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
try
{
for (int i = 0; i < fileNames.Length; i++)
{
string[] ProjectFiles1 = CreateGlobalPropertyProjectFileWithExtension("ABC");
fileNames[i] = ProjectFiles1[0];
tempfilesToDelete[i] = ProjectFiles1[1];
targetNamesPerProject[i] = new string[] { "Build" };
}
// Test building a traversal
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
// Test building the same set of files in parallel
Console.Out.WriteLine("1:"+Process.GetCurrentProcess().MainModule.FileName);
Console.Out.WriteLine("2:" + AppDomain.CurrentDomain.BaseDirectory);
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterDistributedLogger(new ConsoleLogger(LoggerVerbosity.Normal), forwardingLoggerDescription);
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
engine.Shutdown();
// Do the same using singleproc
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFile(traversalProject);
engine.Shutdown();
engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory);
engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]);
}
finally
{
engine.Shutdown();
for (int i = 0; i < fileNames.Length; i++)
{
File.Delete(fileNames[i]);
File.Delete(tempfilesToDelete[i]);
}
File.Delete(traversalProject);
}
}
示例7: Execute
//.........这里部分代码省略.........
pg.AddNewProperty("ErrorReport", "prompt");
pg.AddNewProperty("NoStdLib", "true");
pg.AddNewProperty("NoConfig", "true");
pg.AddNewProperty("WarningLevel", "4");
pg.AddNewProperty("DocumentationFile", "bin\\release\\" + parameters["rimbapi-target-ns"][0] + ".Phone.xml");
// Add reference structure
refItemGroup = phoneProj.AddNewItemGroup();
refItemGroup.AddNewItem("Reference", "System");
refItemGroup.AddNewItem("Reference", "System.Xml");
BuildItem evReference = refItemGroup.AddNewItem("Reference", @"MARC.Everest.Phone");
evReference.SetMetadata("SpecificVersion", "false");
evReference.SetMetadata("HintPath", "lib\\MARC.Everest.Phone.dll");
// Add WP7 Imports
phoneProj.AddNewImport(@"$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets", null);
phoneProj.AddNewImport(@"$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets", null);
// HACK: Add tools version
string fileName = Path.Combine(hostContext.Output, ProjectFileName) + ".Phone.csproj";
phoneProj.Save(fileName);
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
doc.DocumentElement.Attributes.Append(doc.CreateAttribute("ToolsVersion"));
doc.DocumentElement.Attributes["ToolsVersion"].Value = "4.0";
doc.Save(fileName);
if (parameters.ContainsKey("rimbapi-compile") && Convert.ToBoolean(parameters["rimbapi-compile"][0]))
{
System.Diagnostics.Trace.Write(String.Format("Compiling phone project..."), "information");
// Compile
if (phoneEngine.BuildProjectFile(fileName))
System.Diagnostics.Trace.WriteLine("Success!", "information");
else
{
System.Diagnostics.Trace.WriteLine("Fail", "information");
throw new InvalidOperationException("Failed compilation, operation cannot continue");
}
}
}
#endregion
#region Generate Formatter Assemblies
// Generate the formatter assemblies
if (genFormatters.Count > 0 && parameters.ContainsKey("rimbapi-compile") && Convert.ToBoolean(parameters["rimbapi-compile"][0]))
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Trace.WriteLine("Generating ITS Formatter Types:", "information");
// Load the assembly
Assembly genAsm = Assembly.LoadFile(Path.Combine(Path.Combine(Path.Combine(hostContext.Output, "bin"), "release"), ProjectFileName + ".dll"));
foreach (string s in genFormatters)
GenerateFormatterAssembly(s, genAsm, InteractionRenderer.profileId ?? "formatter");
// Assembly resolve
AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
else if (genFormatters.Count > 0)
Trace.WriteLine("Can't use --rimbapi-gen-its when --rimbapi-compile is not true, skipping ITS generation", "warn");
#endregion
示例8: Execute
public void Execute ()
{
bool result = false;
bool show_stacktrace = false;
try {
parameters.ParseArguments (args);
show_stacktrace = (parameters.LoggerVerbosity == LoggerVerbosity.Detailed ||
parameters.LoggerVerbosity == LoggerVerbosity.Diagnostic);
if (!parameters.NoLogo)
ErrorUtilities.ShowVersion (false);
engine = Engine.GlobalEngine;
if (!String.IsNullOrEmpty (parameters.ToolsVersion)) {
if (engine.Toolsets [parameters.ToolsVersion] == null)
ErrorUtilities.ReportError (0, new UnknownToolsVersionException (parameters.ToolsVersion).Message);
engine.DefaultToolsVersion = parameters.ToolsVersion;
}
engine.GlobalProperties = this.parameters.Properties;
if (!parameters.NoConsoleLogger) {
printer = new ConsoleReportPrinter ();
ConsoleLogger cl = new ConsoleLogger (parameters.LoggerVerbosity,
printer.Print, printer.SetForeground, printer.ResetColor);
cl.Parameters = parameters.ConsoleLoggerParameters;
cl.Verbosity = parameters.LoggerVerbosity;
engine.RegisterLogger (cl);
}
if (parameters.FileLoggerParameters != null) {
for (int i = 0; i < parameters.FileLoggerParameters.Length; i ++) {
string fl_params = parameters.FileLoggerParameters [i];
if (fl_params == null)
continue;
var fl = new FileLogger ();
if (fl_params.Length == 0 && i > 0)
fl.Parameters = String.Format ("LogFile=msbuild{0}.log", i);
else
fl.Parameters = fl_params;
engine.RegisterLogger (fl);
}
}
foreach (LoggerInfo li in parameters.Loggers) {
Assembly assembly;
if (li.InfoType == LoadInfoType.AssemblyFilename)
assembly = Assembly.LoadFrom (li.Filename);
else
assembly = Assembly.Load (li.AssemblyName);
ILogger logger = (ILogger)Activator.CreateInstance (assembly.GetType (li.ClassName));
logger.Parameters = li.Parameters;
engine.RegisterLogger (logger);
}
project = engine.CreateNewProject ();
if (parameters.Validate) {
if (parameters.ValidationSchema == null)
project.SchemaFile = defaultSchema;
else
project.SchemaFile = parameters.ValidationSchema;
}
string projectFile = parameters.ProjectFile;
if (!File.Exists (projectFile)) {
ErrorUtilities.ReportError (0, String.Format ("Project file '{0}' not found.", projectFile));
return;
}
result = engine.BuildProjectFile (projectFile, parameters.Targets, null, null, BuildSettings.None, parameters.ToolsVersion);
}
catch (InvalidProjectFileException ipfe) {
ErrorUtilities.ReportError (0, show_stacktrace ? ipfe.ToString () : ipfe.Message);
}
catch (InternalLoggerException ile) {
ErrorUtilities.ReportError (0, show_stacktrace ? ile.ToString () : ile.Message);
}
catch (CommandLineException cle) {
ErrorUtilities.ReportError(cle.ErrorCode, show_stacktrace ? cle.ToString() : cle.Message);
}
finally {
if (engine != null)
engine.UnregisterAllLoggers ();
Environment.Exit (result ? 0 : 1);
}
}
示例9: BuildProjectFileEmptyString
public void BuildProjectFileEmptyString()
{
Engine e = new Engine();
e.BuildProjectFile(String.Empty);
}
示例10: Build
public static bool Build(Project pProj, OutputWindowPane pPane, string pTarget, NameValueCollection pParams)
{
Microsoft.Build.BuildEngine.Engine buildEngine = new Microsoft.Build.BuildEngine.Engine();
BuildExecutor executor = new BuildExecutor(pPane);
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework", false);
if (key == null) {
throw new Exception("Failed to determine .NET Framework install root - no .NETFramework key");
}
string installRoot = key.GetValue("InstallRoot") as string;
if (installRoot == null) {
throw new Exception("Failed to determine .NET Framework install root - no InstallRoot value");
}
key.Close();
buildEngine.BinPath = Path.Combine(installRoot, string.Format("v{0}.{1}.{2}", Environment.Version.Major, Environment.Version.Minor, Environment.Version.Build));
buildEngine.RegisterLogger(executor);
executor.Verbosity = LoggerVerbosity.Normal;
BuildPropertyGroup properties = new BuildPropertyGroup();
foreach (string propKey in pParams.Keys) {
string val = pParams[propKey];
properties.SetProperty(propKey, val, true);
}
return buildEngine.BuildProjectFile(pProj.FileName, new string[]{pTarget}, properties);
}
示例11: MsDeploy
/// <summary>
/// MSDeploy web role project file.
/// </summary>
/// <param name="csprojPath">Full path to web role .csproj file</param>
/// <param name="msDeployDir">Temporary packageTmp folder</param>
/// <returns>MsDeploy success status</returns>
public static bool MsDeploy(string csprojPath, string msDeployDir)
{
Console.WriteLine(" Verifying csproj path...");
try
{
var csprojFileInfo = new FileInfo(csprojPath);
if (!csprojFileInfo.Exists || !csprojFileInfo.Name.EndsWith(".csproj"))
{
Console.WriteLine(" csproj file could not be found at: " + csprojPath);
return false;
}
Console.WriteLine(" csproj found.");
Console.WriteLine(" Building project...");
var engine = new Engine();
var csprojParentDir = csprojFileInfo.Directory;
var logger = new FileLogger { Parameters = "logfile=" + csprojParentDir + @"\publish.log" };
engine.RegisterLogger(logger);
var buildPropGroup = new BuildPropertyGroup();
buildPropGroup.SetProperty("OutDir", msDeployDir);
var deployOnBuildSuccess = engine.BuildProjectFile(csprojPath, new[] { "Rebuild" }, buildPropGroup);
if (deployOnBuildSuccess)
Console.WriteLine(" Successfully MsDeploy project.");
else
Console.WriteLine(" Build failed. Check " + csprojParentDir + @"\publish.log for details.");
engine.UnloadAllProjects();
engine.UnregisterAllLoggers();
return deployOnBuildSuccess;
}
catch (Exception ex)
{
Console.WriteLine(" " + ex.GetType() + ": " + ex.Message);
return false;
}
}
示例12: TestLoadProjectDifferentGP
public void TestLoadProjectDifferentGP()
{
MockLogger logger = new MockLogger();
string path = ObjectModelHelpers.CreateTempFileOnDisk(@"
<Project DefaultTargets=`Build` ToolsVersion=`msbuilddefaulttoolsversion` xmlns=`msbuildnamespace`>
<Target Name=`Build`>
<Warning Text=`This is a scary warning message.` Code=`MSB9999` HelpKeyword=`MSBuild.keyword`/>
<Error Text=`A horrible error has occurred. Be very afraid.` Code=`MSB1111` HelpKeyword=`MSBuild.otherkeyword`/>
</Target>
</Project>
");
Engine engine = new Engine();
Project project = engine.CreateNewProject();
project.Load(path);
project.GlobalProperties.SetProperty("a", "b");
engine.BuildProjectFile(path);
}