Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows Service, Class Library, .NET

Posted on 2009-07-15
1
Medium Priority
?
724 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

From Coral's  "So You Want To Play With Computers" Series A bit of background first, so this story will make a little sense. One day, probably because he needed a good laugh, Finagle hooked me up with a church to upgrade/run their Media Booth.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses

876 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