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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

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
VenabiliCommented:
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
SaggiAuthor 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.