Solved

Windows Service, Class Library, .NET

Posted on 2009-07-15
1
720 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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