Re: WebRequest

Bob Archer <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <[email protected]>
Did you try the references node inside the script node? Look at the docs for the script task:

http://nant.sourceforge.net/release/0.86-beta1/help/tasks/script.html

BOb


From: Lionel Morrison [mailto:[email protected]]
Sent: Wednesday, March 17, 2010 11:12 AM
To: [email protected]
Subject: [NAnt-users] WebRequest

I'm trying to read in a txt file from a website (http://menumax.com/svn_info.txt) . As it is I can't find a task that will allow me to call a URL so I thought I would use C# code block.

My question is how do I get NAnt to include the System.Net  class? I keep getting the follow error

Invalid token 'using' in class, struct, or interface member declaration


Below is my code block. Is it simply that I have the using statement in the wrong place and if so where should I be putting it?

<script language="C#" prefix="lifeware">
      <code>
            <![CDATA[
using System.Net;

[Function("webrequest")]

                  public static string webRequest() {
                        WebRequest request = WebRequest.Create("http://menumax.com/svn_info.txt");

                        return "blablabla";
                  }
            ]]>
      </code>
</script>




Lionel Morrison | Build and Release Engineer | Lifeware TEK
Office: (802) 552-4465 | Cell: (386) 336-7709
Email: [email protected]<[email protected]>
***** CONFIDENTIALITY NOTICE - PLEASE READ FIRST *****

This e-mail message (and all attachments, if any) is intended only for the use of the individual or the authorized representative of the entity to which it is addressed, and may contain information which is confidential and protected from disclosure by law as proprietary information, legally privileged or otherwise.  If you are not the intended recipient, you are hereby notified that you are not to read the contents and any use, disclosure, distribution or copying of the transmitted material is strictly prohibited.  If you have received this e-mail message in error, please immediately contact the sender to confirm the deletion or destruction of this message and all copies.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.