How to write a Build Script for .Net Web Service application using Ant tool?

I have C# .Net Web service and I need write a Build script using Ant tool. Iam new to this build script and Ant tool, appeciate if you can elaborate and explain the steps that needs to be done.
Who is Participating?
SaggiConnect With a Mentor Author Commented:
I got the solution install projects will not build with VCBuild.exe, it has to do with

Thanks for your support!
SaggiAuthor Commented:
Can any one respond to my question please

Evilrix:    Please add the relative zones for my question or suggest me the appropriate zones to add.

Now - the problem is that ANT is not exactly .NET friendly... why do you want to do it with ANT?

You can use I suspect (never used it though) and is usually the way to go if you want ant-like stuff (had used it a few times in the past).

So let's take a step back and see what you need - why ANT?
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

SaggiAuthor Commented:
We already had the ANT build script for vc++ application, now we have new application in which we need a build script.

I have started writing the build script to get the code from SVN and build it, Iam getting the below error:
Poblem: failed to create task or type svn
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Below is the script:
  <project name="IWRS" default="build" basedir=".">
  <description>IWRS Build</description>
  <!--  set global properties for this build
  <property name="svnant.IWRS.url" value="path of code" />
  <property name="basedir" value="C:\IWRS" />
  <property name="svnant.repository.user" value="UID" />
  <property name="svnant.repository.passwd" value="PWD" />
  <path id="svnant.classpath">
  <fileset dir="C:\software\apache-ant-1.8.0-bin\apache-ant-1.8.0\lib">
  <include name="**/*.jar" />
  <!--   load the svn task
  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
  <taskdef resource="net/sf/antcontrib/" />
  <target name="getLatest">
  <echo message="Getting latest from SVN into directory ${basedir}." />
  <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
  <checkout url="${svnant.IWRS.url}" revision="HEAD" destPath="C:\IWRS" />
- <target name="build">
  <antcall target="getLatest" />
SaggiAuthor Commented:
prior to mentioned above error it has:
  [typedef] Could not load definitions from resource org/tigris/subversion/svnan
t/svnantlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontri It could not be found.
Do you have in the system?
Because it looks like ANT cannot find it - and your latest message confirms it.
SaggiAuthor Commented:
I do have SVN installed in my machine but I think class is not set with ANT, How to set/verify?
Also can you please tell me what  "" in my machine?
SaggiAuthor Commented:
It looks like SVN ANT lib (jar) files should be placed!
VenabiliConnect With a Mentor Commented:
You need to download the library and then use something like
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="svnant.jar" />  to tie it.

See for more details.

It looks like your svnant.classpath is not leading where you think it should...
> It looks like SVN ANT lib (jar) files should be placed!

If you mean that you should have them - yes, that is why I asked if you have the library.
SaggiAuthor Commented:
When I build the solution from script Iam getting error for one project ".vdproj error MSB4025 The project file could not be loaded. Data at root level is invalid".

It works fine If I build from VS2005 editor.?
That's an MSBuild error -- so I suspect it is something in the way ant is calling and/or using it in a task.

What kind of project is that? Can you post your build script now?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.