Do you have a personal firewall, or is windows firewall enabled? If so, check it's options to see if there's an application blacklist. It's possible that the first time the program tried to reach teh internet, it popped up a dialog and you answered to disallow it (possibly not even realizing what you were doing). it's also possible that, by default, the access is being disallowed. But you should be able to allow it again. I can't give specifics because I don't know the exact situation, but if a local firewall software component is blocking access to the internet, this would have the same symptoms as not being connected to the internet (for that application). Again, I'm presuming, but it's possible that it only happens after the form designer is open because it's a visual control that's cuasing the check to take place. Another place to look would be if you have any custom controls that access the internet for updates or authentication. (Again, the firewall issue could be at work.) Just thoughts, inspired by the earlier posts. Good luck!
Sonrisante
Posts
-
Build Delay after opening Windows Form designer -
WebClient project... can't compile!Thanks for the note about replies; I had thought that any new entry in the thread would notify you. What I meant by "registering" was really "adding a reference". Thanks for clarifying, wording is very important in these things. I had the
using System;
andusing System.Net;
statements in the code, because it was copied from the sample I took from MSDN. I don't remember exactly why, but for some reason I thought I needed to add a reference to System.Net to use this functionality. So I did. In VS2008, I can do this, and it results in the problem I found. This is probably because the System.Net.xml file exists and, by adding a reference to it, the core System.Net gets overshadowed. (Makes me wonder why they allow me to add a reference to it in the first place.) When I went to my old machine, which had an earlier version of VS and .NET 2.0 framework, I could not add the reference to System.Net, presumably because the System.Net.xml file didn't exist in that version of the framework. What I don't remember is whether I tried to compile my initial project, and some failure caused me to decide to add the reference. It's likely that I just outsmarted myself in thinking that networking components would be something that had to be "linked in" instead of available by default. Regards, Bob Smiley Pleasanton, CA -
WebClient project... can't compile!Luc: The more I thought of it, the more it came back to something incorrect on my side, from a programmer's standpoint, not a setup standpoint. And indeed that was the issue. I had added a reference for
System.Net
when I really only needed a reference toSystem
. I'm not sure how I could have found that out... the differences between namespaces and references are still mysterious to me, and I don't exactly know why the namespace doesn't include, if not infer, the required references (or vice versa). In case you're interested, here's how I figured it out. I actually booted up an old PC from 2 years ago that I just hadn't gotten around to trashing yet; it had an old VS on it (prior to 2003). I created the project, and when trying to add the reference toSystem.Net
it would not allow me to. So I didn't. I compiled it, and it compiled and ran perfectly! So, I copied that very project to my new machine, which "upgraded" it to the current version, and it ran perfectly as well. When I checked the references, it hadSystem
but notSystem.Net
listed. Does this sound like it might be what you ran across that time when you found the same issue but it just sort of disappeared on its own? Thanks for watching this thread; your feedback helped me get to discovering my misunderstanding, and a cleaner hard disk as a bonus! :-D 7/23/2008: edited to clarify that I was referring to "References" which I mistakenly called "Registrations", as pointed out in Luc's reply to this message. -
WebClient project... can't compile!Neither the "full distribution" nor uninstalling all legacy visual studio components and then reinstalling only VS2008 worked, although now I have more disk space! I did find this MSDN thread that at first glance I thought was describing my problem, but it turns out it was a red herring. Even so, I've posted my plight in that thread to see if any help will be forthcoming from there, which I will then repost here. http://forums.msdn.microsoft.com/en-US/vssetup/thread/a3da6655-0fa6-47f9-adb8-ff8943a24d48/[^]
-
WebClient project... can't compile!Status report so far:
- Uninstalled all prior versions of Visual Studio: this didn't make the problem go away, but it didn't make anything worse, and now I have a faster computer.
- Uninstalled all versions of .NET Framework (non-compact).
- Reinstalled .NET Framework 3.5: still didn't fix the problem. But Frameworks #1.0, 2.0 SP1, 3.0 SP1, and 3.5 all show up again in the Add/Remove programs list, so at least it thinks that all versions were installed.
I've now gone back to the Microsoft Website and downloaded the "full redistributable" version (197MB) to see if that will make any difference. Apparently I was using a "bootstrapped" version before. I wouldn't expect this to make any difference, but what have I got to lose? If this doesn't work, then I'll uninstall all Visual Studio and related applications, and reinstall the whole kit and kaboodle.
-
WebClient project... can't compile!Thanks Luc. With encouragement like that, I will definitely keep the updates coming. I've already uninstalled and reinstalled .NET 3.5 with no improvement. So my next step will be to uninstall the full .NET framework, in reverse version order as you suggest. Actually, before I do that, I'll probably do some other clean-up, such as removing C# 2005 Express that I've had on there, and old SQL Server versions as well. If I'm going to clean up, I might as well clean up! But I'll check in between the steps to see if any one thing happens to "correct" it before doing the full-scale .NET framework reinstall. For documentation purposes, I'll list what I have showing up in my Add/Remove Programs for my computer (XP Media Center edition 2005):
- Microsoft .NET Compact Framework 2.0 SP2
- Microsoft .NET Compact Framework 3.5
- Microsoft .NET Framework 1.0 Hotfix (KB887998)
- Microsoft .NET Framework 1.0 Hotfix (KB930494)
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.1 Hotfix (KB928366)
- Microsoft .NET Framework 2.0 Service Pack 1
- .NET Framework CLR
- .NET Framework 2
- .NET Framework PreXP
- .NET Framework WinForms
- .NET Framework 1
- Dr. Watson
- .NET Framework CRT
- .NET Framework CA
- .NET Framework ASP .NET
- Microsoft .NET Framework 3.0 Service Pack 1
- NET Framework WPF 2
- NET Framework WPF 3
- NET Framework WPF 1
- .NET Framework WF x86
- NET Framework WPF 3 x86
- .NET Framework XPS
- .NET Framework WF
- NET Framework WPF 2 x86
- .NET Framework WCS
- .NET Framework WCF
- Microsoft .NET Framework 3.5
Of course, there are also many items listed for Visual Studio and related tools, but these are what I have listed for the Framework.
-
WebClient project... can't compile!OK, I promise this will be my last posting, but I found what might be another hint. When typing in the editor, the autocomplete only lists two items under System.Net. - IPEndPointCollection (interface) - PeerToPeer (class) So, my suspicion is that it's only seeing the 3.5 additions, and not getting back to the core framework. I'm not sure how to fix this, if it is the case; nor do I know how to tell whether that's the case. (I found and looked at the System.Net.xml file and see that only these items are listed.) If this sheds any light for anyone, I'd once again appreciate the help. My next step, if it must come to it, would be to (with much trepidation) uninstall all .NET framework versions and then install 3.5, hoping it will install the previous versions, and all will be happy in XP land again. (My concern in doing this is a fear of breaking other things that have been working, such as Office or other application software.) Thanks again, Bob Smiley Pleasanton, CA
-
WebClient project... can't compile!Luc: Thanks again for your assistance. I wonder if I can trouble you for one more thing. I reinstalled VS2008 and it didn't change anything. But I've had VS2005 and didn't remove it before installing VS2008. So I'm wondering if there's a conflict. Also, I notice that my .NET framework sizes are very suspicious.
.NET Framework 2.0 SP1 = 185.00 MB
.NET Framework 3.0 SP1 = 245.00 MB
.NET Framework 3.5 = 27.93 MBSo I'm wondering if my 3.5 framework didn't install fully. Can you check your framework sizes to see if they match the list above? (I took that list from Add/Remove Programs dialog in my XP Pro.) Thanks again for your help.
-
WebClient project... can't compile!Luc: Thanks for the response. I have in fact created the project multiple times, and have also tried using different objects in the System.Net namespace. Something must be amiss with my compiler installation. I'll try a repair (or reinstall) and see if that helps. Thanks for confirming that there's no additional setup required. I thought maybe I needed to set a particular configuration or download a specific add-on module. Regards, Bob
-
WebClient project... can't compile!I'm having a problem with a brand new project that I'm sure is just a dumb oversight on my part. This is my first VS2008 project (I've used C# 2005 before) and my first use of the System.Net namespace. Basically, to keep my first step simple, I'm merely trying to compile the following sample code snippet that I pulled from MSDN:
using System;
using System.IO;
using System.Net;
using System.Text;namespace Project5
{ public class Project5
{
public static void Main(string[] args)
{WebClient client = new WebClient(); // Add a user agent header in case the // requested URI contains a query. client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705 ; )"); Stream data = client.OpenRead("http://www.net-chess.com/mylist.cgi"); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); Console.WriteLine(s); data.Close(); reader.Close(); } }
}
but I receive the following error:
error CS0246: The type or namespace name 'WebClient' could not be found (are you missing a using directive or an assembly reference?)
I've got a reference setup to theSystem.Net.dll
assembly. I'm sure I'm just missing a brain-dead setup step somewhere. If anyone can help, I'd really appreciate it. Regards, Bob -
Favourite interview questionsI've not tried this myself, but I've heard of people who use their interview time as a pair programming session. if you use pair programming, spending 30-60 minutes with someone doing pair programming on a well-defined problem that you haven't already solved yourself is a great way to test compatibility, their thought process, and the like.
-
Test Driven DevAs soon as you're not the only one modifying it, and you need someone else to help you on modifications to some segement you wrote, or you need to pass it off to someone else entirely, the value of TDD would become very apparent. Modifying a line of code inside a function or procedure embedded within the bowels of a code body is always nerve-wracking, especially for someone who didn't write it to begin with (and in my case, I find it so even if I did write it but it was long enough ago that I can't downright remember all the ins and outs... after 15 years of developing applications, even the ones I did last year are hard to remember all the details of). With TDD, I modify the line that I *think* I need to modify, run the tests, and I'll see instantly whether I broke something elsewhere that I never would have imagined. In fact, I can use TDD to help me identify a better way to make a modification in these cases. The most difficult thing I find with TDD is deciding when is enough... it's tempting to test everything but that will never end. And you don't want to write tests in a way that will break everything if you have a design change. So it's as much of a design skill as writing the code itself. It's also a great confidence builder as you see that the tests are actually passing and continue to pass as you build your app.