I believe it is possible on 0.85, as we are targeting MS 2008, and the  
solutions (in some cases) are targeted at the .NET 2.0, even though  
they are VS 2008 solutions.

The fix was that I had to tweak the Nant.config file like so...:

I had to add a framework node into the config file (see below).  This  
goes in parallel with all the other framework nodes in  
configuration/nant/frameworks/platform.

    -Jacob

(ugly XML content directly from my nant.config file below)

<framework
                                        name="net-3.5"
                                        family="net"
                                        version="3.5"
                                        description="Microsoft .NET Framework 
3.5"
                                        runtimeengine=""
                                        
sdkdirectory="${path::combine(sdkInstallRoot, 'bin')}"
                                        
frameworkdirectory="${path::combine(installRoot, 'v3.5')}"
                                        
frameworkassemblydirectory="${path::combine(installRoot, 'v2.0.50727')}"
                                        clrversion="2.0.50727">
                                        <task-assemblies>
                                        <!-- include .NET specific assemblies 
-->
                                        <include name="tasks/net/*.dll" />
                                        <!-- include .NET 2.0 specific 
assemblies -->
                                        <include name="tasks/net/2.0/**/*.dll" 
/>
                                        <!-- include Microsoft.NET specific 
task assembly -->
                                        <include name="NAnt.MSNetTasks.dll" />
                                        <!-- include Microsoft.NET specific 
test assembly -->
                                        <include name="NAnt.MSNet.Tests.dll" />
                                        </task-assemblies>
                                    <project>
                                        <readregistry
                                                        property="installRoot"
                                                        
key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
                                                        hive="LocalMachine" />
                                                <readregistry
                                                        
property="sdkInstallRoot"
                                                        
key="SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0"
                                                        hive="LocalMachine"
                                                        failonerror="false" />
                                        </project>
                                        <tasks>
                                                <task name="csc">
                                            <attribute 
name="exename">csc</attribute>
                                            <attribute 
name="supportsnowarnlist">true</attribute>
                                            <attribute 
name="supportswarnaserrorlist">true</attribute>
                                            <attribute 
name="supportskeycontainer">true</attribute>
                                            <attribute 
name="supportskeyfile">true</attribute>
                                            <attribute 
name="supportsplatform">true</attribute>
                                            <attribute 
name="supportslangversion">true</attribute>
                                                </task>
                                        <task name="vbc">
                                            <attribute 
name="exename">vbc</attribute>
                                            <attribute 
name="supportsdocgeneration">true</attribute>
                                            <attribute 
name="supportsnostdlib">true</attribute>
                                            <attribute 
name="supportsnowarnlist">true</attribute>
                                            <attribute 
name="supportskeycontainer">true</attribute>
                                            <attribute 
name="supportskeyfile">true</attribute>
                                            <attribute 
name="supportsplatform">true</attribute>
                                            <attribute 
name="supportswarnaserrorlist">true</attribute>
                                        </task>
                                        <task name="jsc">
                                            <attribute 
name="exename">jsc</attribute>
                                            <attribute 
name="supportsplatform">true</attribute>
                                        </task>
                                        <task name="vjc">
                                            <attribute 
name="exename">vjc</attribute>
                                            <attribute 
name="supportsnowarnlist">true</attribute>
                                            <attribute 
name="supportskeycontainer">true</attribute>
                                            <attribute 
name="supportskeyfile">true</attribute>
                                        </task>
                                        <task name="resgen">
                                            <attribute 
name="exename">resgen</attribute>
                                            <attribute 
name="supportsassemblyreferences">true</attribute>
                                            <attribute  
name="supportsexternalfilereferences">true</attribute>
                                        </task>
                                        <task name="al">
                                            <attribute 
name="exename">al</attribute>
                                        </task>
                                        <task name="delay-sign">
                                            <attribute 
name="exename">sn</attribute>
                                        </task>
                                        <task name="license">
                                            <attribute 
name="exename">lc</attribute>
                                            <attribute 
name="supportsassemblyreferences">true</attribute>
                                        </task>
                                        <task name="ilasm">
                                            <attribute 
name="exename">ilasm</attribute>
                                        </task>
                                        <task name="ildasm">
                                            <attribute 
name="exename">ildasm</attribute>
                                        </task>
                                    </tasks>
                                </framework>



Quoting Bob Archer <bob.arc...@amsi.com>:

> Right, but if you are using VS 2008 when you build it is using MSBuild
> 3.5. This build version respects the multi-targeting of VS2008. VS2008
> will update your .sln file to it's version. So, when you run MSBuild 2.0
> it knows it can't support that .sln file.
>
>
>
> So, you have to tell Nant to use the 3.5 msbuild.exe in order for this
> to work. Even if you are targeting .Net 2.0.
>
>
>
> Does that make sense?
>
>
>
> I'm not sure if this is doable in .85 if you are using the msbuild task,
> you may need to swap to the exec and call msbuild 3.5.
>
>
>
> Perhaps gert of someone else that has done this can help here.
>
>
>
> BOb
>
>
>
>
>
>
>
> ________________________________
>
> From: Zachary B. Wheeler [mailto:zwhee...@sddmtech.com]
> Sent: Friday, February 13, 2009 2:49 PM
> To: Bob Archer
> Subject: RE: [NAnt-users] nant , vs 2008 on 2.0 framework
>
>
>
> My client is using the 2.0 framework and not the 3.5 framework so all
> projects have been built using the 2.0 framework in vs 2008
>
>
>
>
>
> Zachary B. Wheeler
>
> Principal
>
> www.sddmtech.com
>
> "We Listen To Our Customers"
>
> Contact: 202.528.8969
>
> Toll Free: 866.830.4147
>
> Fax: 202.478.2886
>
>
>
> From: Bob Archer [mailto:bob.arc...@amsi.com]
> Sent: Friday, February 13, 2009 2:43 PM
> To: Zachary B. Wheeler; nant-users@lists.sourceforge.net
> Subject: RE: [NAnt-users] nant , vs 2008 on 2.0 framework
>
>
>
> Are you sure it is running the msbuild.exe in the 3.5 .Net framework
> folder? What version are you using... there was some recent work in the
> nightly builds and .86 (IIRC) on framework targeting and version
> detection.
>
>
>
> BOb
>
>
>
>
>
> ________________________________
>
> From: Zachary B. Wheeler [mailto:zwhee...@sddmtech.com]
> Sent: Friday, February 13, 2009 2:28 PM
> To: nant-users@lists.sourceforge.net
> Subject: [NAnt-users] nant , vs 2008 on 2.0 framework
>
>
>
> I am using nant to build a project vs2008 but on a 2.0 framework and I
> keep running in to the following error:
>
>
>
> File format version is unrecognized: MSBUILD can only read solution
> files between versions 7 and 9 inclusive
>
>
>
> Has anyone else had this problem ? if so what is the work around?
>
>
>
> Zachary B. Wheeler
>
> Principal
>
> www.sddmtech.com
>
> "We Listen To Our Customers"
>
> Contact: 202.528.8969
>
> Toll Free: 866.830.4147
>
> Fax: 202.478.2886
>
>
>
>



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to