构建VS2008项目与.net 2.0 / .NET 3.5使用楠 [英] Build VS2008 projects with .Net 2.0/.Net 3.5 using NAnt

查看:176
本文介绍了构建VS2008项目与.net 2.0 / .NET 3.5使用楠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图写一个构建文件来构建一个简单的C#解决方案,但它失败,出现错误:未知的任务或数据类型

我的解决办法是用VS2008,但针对。NET 2.0(我使用的是Vista是否有帮助)。

我已经看到了另一个问题<一href="http://stackoverflow.com/questions/626774/running-builds-using-net-3-5-msbuild-and-nantcontrib">running-builds-using-net-3-5-msbuild-and-nantcontrib并尝试提出解决方案,并已进行了更改,以我的NAnt.exe.config文件。

我试着改变溶液性质.NET 3.5的目标(并相应修改构建文件,但没有成功)。

任何人都可以提出什么我可能会丢失?

我的构建文件如下:

 &LT; XML版本=1.0&GT?;
    &LT;项目名称=HelloWorld的默认设置为建的basedir =&gt的帮助。
    &LT;描述&GT;构建HelloWorld项目&LT; /描述&GT;
    &lt;目标名称=构建描述=编译源$ C ​​$ C&GT;
        &LT;回声&GT;建筑的Hello World&LT; /回声&GT;
        &LT;属性名=nant.settings.currentframework值=网2.0/&GT;
        &LT; MSBuild项目=HelloWorld.sln&GT;
            &LT;属性名=配置值=调试/&GT;
        &LT; /的MSBuild&GT;
    &LT; /目标和GT;
&LT; /项目&GT;
 

解决方案

MS版本是在Nantcontrib库的任务。你必须下载该把它放在你的构建工具可以得到它,然后MSBuild任务之前使用LoadTask:

 &LT; loadtasks组装=C:\富\ NAnt.Contrib.Tasks.dll/&GT;
 

一旦你做到这一点,应该能正常运行。

I'm trying to write a build file to build a simple C# solution but it is failing with the error: Unknown task or datatype.

My solution is written in VS2008 but targeted at .Net 2.0 (I'm using Vista if that helps).

I've already seen the other question running-builds-using-net-3-5-msbuild-and-nantcontrib and have tried the suggested solution and have made the change to my NAnt.exe.config file.

I've tried changing the solution properties to target .net 3.5 (and changing the build file accordingly, but with no success).

Can anyone suggest anything I might be missing?

My build file is as follows:

<?xml version="1.0"?>
    <project name="HelloWorld" default="build" basedir=".">
    <description>Builds the HelloWorld project.</description>
    <target name="build" description="compiles the source code">
        <echo>Building Hello World</echo>
        <property name="nant.settings.currentframework" value="net-2.0" />
        <msbuild project="HelloWorld.sln">
            <property name="Configuration" value="debug" />
        </msbuild>
    </target>
</project>

解决方案

ms build is a task in the Nantcontrib library. You have to download that put it where your build tool can get to it and then before the msbuild task use the LoadTask:

<loadtasks assembly="c:\foo\NAnt.Contrib.Tasks.dll" />

Once you do this it should work fine.

这篇关于构建VS2008项目与.net 2.0 / .NET 3.5使用楠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆