用ant或nant构建c# [英] building c# with ant or nant

查看:116
本文介绍了用ant或nant构建c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我从Visual Studio 2005项目编译了一个.dll文件

包含几十个c#文件。现在我想使用

ant自动化这个构建(还没有看过nant,但我的复杂构建的其余部分已完成

with plain ant)。有人可以指点我的任何教程或其他指南

这样做吗?我甚至会满足于如何从命令行执行此操作。

So I have compiled a .dll file from a Visual Studio 2005 project
containing a few dozen c# files. Now I want to automate this build using
ant (have not yet looked at nant, but the rest of my complex build is done
with plain ant). Could someone point me to any tutorial or other guide for
doing this? I would even settle for just how to do it from a command-line.

推荐答案

http://www.baccoubonneville.com/blog.../nant-tutorial


我还推荐使用Nant的Expert .NET Delivery。


干杯,


Greg Young

MVP - C#
http:/ /codebetter.com/blogs/gregyoung


" michael sorens" < m _ ******** @ community.nospamwrote in message

news:op *************** @ spo-cont-2- dt.itron.com ...
http://www.baccoubonneville.com/blog.../nant-tutorial

I would also recommend Expert .NET Delivery using Nant.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

"michael sorens" <m_********@community.nospamwrote in message
news:op***************@spo-cont-2-dt.itron.com...

所以我从Visual Studio 2005项目编译了一个.dll文件

包含几打c#文件。现在我想使用

ant自动化这个构建(还没有看过nant,但我的复杂构建的其余部分已完成

with plain ant)。有人可以指点我的任何教程或其他指南

这样做吗?我甚至会满足于如何从命令行执行此操作。
So I have compiled a .dll file from a Visual Studio 2005 project
containing a few dozen c# files. Now I want to automate this build using
ant (have not yet looked at nant, but the rest of my complex build is done
with plain ant). Could someone point me to any tutorial or other guide for
doing this? I would even settle for just how to do it from a command-line.



感谢Greg提供的信息。


嗨迈克尔,


感谢您的发帖。


除了Greg关于使用NAnt的建议,您还可以使用ANT构建VS2005

项目:


#ANT .NET任务
http://ant.apache.org/manual/OptionalTask​​s/dotnet.html

您可以使用Csc建立你的C#项目的任务,但它要求你重新指定包含的C#源文件和引用的库。


另一种选择是使用ANT Exec任务

http:// ant。 apache.org/manual/CoreTasks/exec.html )调用Devenv.exe:


#Devenv命令行开关
http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx

您可以使用/ Build切换到构建现有的Visual Studio 2005

解决方案或项目。


希望这会有所帮助。如果有什么不清楚的话,请随时在这里发帖。


问候,

Walter Wang(wa****@online.microsoft.com,删除' '在线'。')

微软在线社区支持


==================== ==============================

在回复帖子时,请回复群组通过你的新闻阅读器

其他人可以从你的问题中学习并从中受益。

==================== ==============================

此帖子提供按现状 ;没有保证,也没有授予任何权利。

Thanks Greg for your informative input.

Hi Michael,

Thank you for your post.

Besides Greg''s suggestion on using NAnt, you can use ANT to build VS2005
project:

#ANT .NET Tasks
http://ant.apache.org/manual/OptionalTasks/dotnet.html
You can use "Csc" task to build your C# project, but it requires you to
re-specify included C# source files and referenced libraries.

Another option is to use ANT Exec task
(http://ant.apache.org/manual/CoreTasks/exec.html) to call Devenv.exe:

#Devenv Command Line Switches
http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx
You can use "/Build" switch to build an existing Visual Studio 2005
solution or project.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


感谢Walter。这些都是很好的文档指针。从您的

信息中,我观察到虽然ant中的DotNet任务在某种意义上提供了本机

支持,但它们需要一个指定
build,已在解决方案文件中提供。所以坚持懒惰的优秀编程实践,看起来好像使用ant exec

任务来调用devenv,它可以直接使用解决方案文件,将是

最简单的实现。


周五,2006年7月7日01:19:19 -0700,Walter Wang [MSFT]

< wa **** @ online.microsoft.comwrote:
Thanks Walter. These are good documentation pointers. From your
information, I observe that while the DotNet tasks in ant provide "native"
support in a sense, they require one to specify the architecture of the
build, which is already available in the solution file. So adhering to the
Good Programming Practice of laziness, it looks like using the ant exec
task to invoke devenv, which can directly use the solution file, would be
the simplest to implement.

On Fri, 07 Jul 2006 01:19:19 -0700, Walter Wang [MSFT]
<wa****@online.microsoft.comwrote:

感谢Greg提供的信息。


你好Michael,


感谢您的发帖。


除了Greg关于使用NAnt的建议,您还可以使用ANT构建VS2005 < br $>
项目:


#ANT .NET任务
http://ant.apache.org/manual/OptionalTask​​s/dotnet.html

您可以使用Csc建立你的C#项目的任务,但它要求你重新指定包含的C#源文件和引用的库。


另一种选择是使用ANT Exec任务

http:// ant。 apache.org/manual/CoreTasks/exec.html )调用Devenv.exe:


#Devenv命令行开关
http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx

您可以使用/ Build切换到构建现有的Visual Studio 2005

解决方案或项目。


希望这会有所帮助。如果有什么不清楚的话,请随时在这里发帖。


问候,

Walter Wang(wa****@online.microsoft.com,删除' '在线'。')

微软在线社区支持


==================== ==============================

在回复帖子时,请回复群组通过你的新闻阅读器

其他人可以从你的问题中学习并从中受益。

==================== ==============================

此帖子提供按现状 ;没有保证,也没有赋予

权利。
Thanks Greg for your informative input.

Hi Michael,

Thank you for your post.

Besides Greg''s suggestion on using NAnt, you can use ANT to build VS2005
project:

#ANT .NET Tasks
http://ant.apache.org/manual/OptionalTasks/dotnet.html
You can use "Csc" task to build your C# project, but it requires you to
re-specify included C# source files and referenced libraries.

Another option is to use ANT Exec task
(http://ant.apache.org/manual/CoreTasks/exec.html) to call Devenv.exe:

#Devenv Command Line Switches
http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx
You can use "/Build" switch to build an existing Visual Studio 2005
solution or project.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.


这篇关于用ant或nant构建c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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