By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,052 Members | 1,551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,052 IT Pros & Developers. It's quick & easy.

BuildEngine

P: n/a
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\Clas s1.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.507 27";

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("----------------------------------");
Sep 25 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Joe,
Error 1 Invalid token '=' in class, struct, or interface member
declaration C:\Data\DotNet\CSharp\XML\ParseCSharpProjFile\Clas s1.cs 23 20
ParseCSharpProjFile
Your code must reside inside a method. I can't see you having one!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Sep 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.