Solved

Windows Service, Class Library, .NET

Posted on 2009-07-15
1
719 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 Winforms Signing 13 32
FInd Image Control Gridview 3 21
LINQ Select all records by MAX data syntax help 1 18
How to filter by key press ? 6 23
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.…
Nowadays, Virtual Machines are used equally by small and large scale organizations. However the issue is that VMDK files are also prone to corruption. So, in this article we are looking at how to recover VMDK files from hard disk of host operating s…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

837 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