Solved

Windows Service, Class Library, .NET

Posted on 2009-07-15
1
716 Views
Last Modified: 2012-05-07
I am planning to write a windows service which will download every day at a certain time, some files from an external web server -

I created a solution with a project for a command line version, a class library, and a service -

I plan to have the service, and the command line both use the class library to actually do the heavy lifting of the work - the command line is mostly to ensure that the class works properly.


Now, it seems:
This does work, but I am unable to see myReq.Method or anything, I get errors,

can I not use this in the class library? If so, what other solutions do I have?

myReq.Method does not work, nor does anything show up in intellisense for it
HttpWebRequest myReq =

(HttpWebRequest)WebRequest.Create("http://www.ding.com");

Open in new window

0
Comment
Question by:mdeek
1 Comment
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 24863964
Make sure you have a

using System.Net;

at the top of code files referencing WebRequest objects, or use long-hand

System.Net.HttpWebRequest myReq = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(...);
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Introduction Many people don't know about it - and it's almost like a huge secret, but Hyper-V is one of the most cost-effective Virtual solutions out there, and I'll tell you why. In a single word - Licensing. The Breakdown Microsoft gi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now