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.
SaggiAsked:
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 devenv.com.

Thanks for your support!
0
 
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.
0
 
VenabiliCommented:
Hm.

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

You can use http://ant.apache.org/antlibs/dotnet/ I suspect (never used it though) and http://nant.sourceforge.net/ 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?
0
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 C#.net 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" />
  </fileset>
  </path>
  <!--   load the svn task
  -->
  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
  <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
  <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" />
  </svn>
  </target>
- <target name="build">
  <antcall target="getLatest" />
  </target>
  </project>
0
 
SaggiAuthor Commented:
prior to mentioned above error it has:
build:
  [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
b.properties. It could not be found.
0
 
VenabiliCommented:
Do you have http://subclipse.tigris.org/svnant.html in the system?
0
 
VenabiliCommented:
Because it looks like ANT cannot find it - and your latest message confirms it.
0
 
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  "http://subclipse.tigris.org/svnant.html" in my machine?
0
 
SaggiAuthor Commented:
It looks like SVN ANT lib (jar) files should be placed!
0
 
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 http://subclipse.tigris.org/svnant/svn.html for more details.

It looks like your svnant.classpath is not leading where you think it should...
0
 
VenabiliCommented:
> 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.
0
 
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.?
0
 
VenabiliCommented:
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?
0
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.