J
Joe
Hi anyone use the BuildEngine Class
I cannot get code from MSDN to compile. I get the following error.
I am trying to us it to parse csproj file
thanks
at line
engine = new Microsoft.Build.BuildEngine.Engine(binPath);
get this error
Error 1 Invalid token '=' in class, struct, or interface member declaration
C:\Data\DotNet\CSharp\XML\ParseCSharpProjFile\Class1.cs 23 20
ParseCSharpProjFile
using System.Reflection;
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.XBuild.Framework;
using Mono.XBuild.Utilities;
namespace ParseCSharpProjFile
{
class Class1
{
// Instantiate a new Engine object
Microsoft.Build.BuildEngine.Engine engine;
// Point to the path that contains the .NET Framework 2.0 CLR and tools
string binPath = "C:\\WINNT\\Microsoft.NET\\framework\\v2.0.50727";
engine = new Microsoft.Build.BuildEngine.Engine(binPath);
// Create a new empty project
Project project = new Project();
// Load a project
project.Load(@"c:\temp\validate.proj");
Console.WriteLine("Project Properties");
Console.WriteLine("----------------------------------");
I cannot get code from MSDN to compile. I get the following error.
I am trying to us it to parse csproj file
thanks
at line
engine = new Microsoft.Build.BuildEngine.Engine(binPath);
get this error
Error 1 Invalid token '=' in class, struct, or interface member declaration
C:\Data\DotNet\CSharp\XML\ParseCSharpProjFile\Class1.cs 23 20
ParseCSharpProjFile
using System.Reflection;
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.XBuild.Framework;
using Mono.XBuild.Utilities;
namespace ParseCSharpProjFile
{
class Class1
{
// Instantiate a new Engine object
Microsoft.Build.BuildEngine.Engine engine;
// Point to the path that contains the .NET Framework 2.0 CLR and tools
string binPath = "C:\\WINNT\\Microsoft.NET\\framework\\v2.0.50727";
engine = new Microsoft.Build.BuildEngine.Engine(binPath);
// Create a new empty project
Project project = new Project();
// Load a project
project.Load(@"c:\temp\validate.proj");
Console.WriteLine("Project Properties");
Console.WriteLine("----------------------------------");