Title: Differentiating .NET 2003 / 2005 solution

The only way I know of is to open the solution file and look at the first couple of lines

 

Visual Studio .NET 2003 has the following:

 

Microsoft Visual Studio Solution File, Format Version 8.00

 

Visual Studio .NET 2005 has the following:

 

Microsoft Visual Studio Solution File, Format Version 9.00

# Visual Studio 2005

 

Something like the following should work, but it’s not great because it loads the entire solution file before checking it.  You probably just want to check the first couple of lines.

I haven’t tested it so you may need to work on it a little.

 

<target name=”ProcessSolution” >

<loadfile  file=”filename.sln”   property=”solutionProperty” />

 

<regex pattern=”(?’net2003’Format Version 8.00)”  input=”${solutionProperty}”  />

<regex pattern=”(?’net2005’Format Version 9.00)”  input=”${solutionProperty}”  />

 

<call target=”ProcessVS2003”  if=”${property::exists(net2003)}”  />

<call target=”ProcessVS2005”  if=”${property::exists(net2005)}”  />

</target>

 

<target name=”ProcessVS2003” >

 

</target>

 

<target name=”ProcessVS2005” >

 

</target>

 

 

Noel


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Tomiczek
Sent: Sunday, January 29, 2006 6:36 AM
To: [email protected]
Subject: [NAnt-users] Differentiating .NET 2003 / 2005 solution

 

Anyone knows an easy and fast way to differentiate betwene a .NET 2003 and a .NET 2005 solution file?

I want to run a switch over our build task to move into a separate build setup based on whether a .sln is for VS.NET 2003 or 2005. Naturally I need a fast way to differentiate them.

Thomas Tomiczek

Reply via email to