Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Service, Class Library, .NET

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

When working with Microsoft SCVMM (System Center Virtual Machine Manager) in a Hyper-V virtualization environment, we have run across scenarios in which the failed migration of a VM from one host to another may leave the VM in a failed state. Specif…
Few best practices specific to Network Configurations to be considered while deploying a Hyper-V infrastructure. It may not be the full list, but this could be a base line. Dedicated Network: Always consider dedicated network/VLAN for Hyper-V…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

715 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