Tag: Microsoft

  • Visual Studio vs mIRC

    I’m doing some ASP.NET development in Visual Studio 2005 at the moment, and I’ve spent the last half hour beating my head against the wall because of an obscure error message:

    ASP.NET Development Server failed to start listening on port 1651.
    Error message:
    Only one usage of each socket address (protocol/network address/port) is normally permitted.

    This happened whenever I tried to run the application, or use the ASP.NET Configuration utility. (The idea is that Visual Studio has its own webserver built in, so you don’t need to have IIS or equivalent installed on your development machine.)

    I went to a command prompt and ran “netstat -a” to see whether anything else was using that port. Port 1651 wasn’t listed there, although 1652-1654 were. I ran the command again as “netstat -a -b | more” to find out ownership info, and it turned out that mIRC was using those nearby ports. So, I closed mIRC down, and was able to run the ASP.NET apps without any trouble.

    Curiously, I then restarted mIRC, and I could still run the ASP.NET apps. Running netstat again, I saw that “WebDev.WebServer.EXE” was using port 1651 and “mirc.exe” was using port 2064. So, there’s probably a random element to port assignment.

    Hopefully this info will be useful to other people: even if you aren’t using the same applications as me, the basic principle should still be valid (e.g. if Apache is conflicting with iTunes).

  • SQL Server

    Today I’ve been copying a database from one SQL Server machine to another: specifically from SQL 2000 to SQL 2005, for testing purposes. Unfortunately this didn’t go as smoothly as I would have liked, so here are a few notes for anyone else who does this (e.g. my future self).

    (more…)

  • Anatomy of a hack: SBS 2000

    A few years ago (August 2002), my home server got hacked. I dealt with it fairly quickly, but it took me a while to really understand what had happened, because I was more naïve about security in those days.

    (more…)

  • Windows Vista: first impressions

    Two weeks ago I went off to a Microsoft event in Reading: “Ready for a New Day: Microsoft’s Launch of Exchange, Office and Vista”. That was quite interesting, and I came away thinking that there are enough useful features to justify an upgrade. They gave me a freebie copy of Windows Vista and Office 2007 for attending; that’s quite a nice touch, especially since the event itself was free. Now that I’ve been doing some presenting myself, I could sympathise with the people at the front when their demos didn’t quite work properly, and I particularly liked the heartfelt cry of “Thank you, demo gods!” when something went smoothly.

    Speaking of Vista, I recently received an email from Microsoft, offering me a place on a beta certification exam. I passed the MCDST exams for Windows XP a couple of years ago and Microsoft are now preparing the equivalent MCITP qualification for Windows Vista. The idea of the beta exam is that they can get an idea of whether the questions are too easy/difficult by trying them out on people with a (roughly) known skill level. Anyway, I’m flattered to be invited, and it’s a free exam, so I’ve signed up for that on 5th January. The only snag is that there aren’t any study guides etc. available yet (the people who write them will probably be doing the beta exams too), so I’ll need to prepare for it on my own. Still, I’ve passed all my previous Microsoft exams on my first attempt (8 so far), so I’m quietly confident about this one.

    Vista won’t be available as a retail product until January 27th, and Microsoft haven’t sent out any DVDs to business customers yet, but companies with volume licencing deals can download it. I’ve been playing with it on my home machine, so that I can get a feel for it before I do any big deployments at work; here are my thoughts so far.

    (more…)

  • Upgrading to Visual Studio 2005

    Today I got my copy of Visual Studio 2005 through the post, so I’ve been having a play with that, by upgrading some of my VB.NET 2003 projects. Unfortunately, I got a rather confusing error message from them, and I couldn’t find much info on the web, so I’m documenting it here for other people’s benefit.

    The error is something like this:
    ‘FMain’ is a type in ‘Presentation’ and cannot be used as an expression.
    where FMain is the name of my startup form and Presentation is the name of the project. However, there’s no line number given, and I can’t find any code that refers to the form.

    If I then go to Project Properties, and check the box for “Enable application framework”, that displays an error message that says “Startup object must be a form when ‘Enable application framework’ is checked.” In my case, the startup object is a form (i.e. it inherits from System.Windows.Form), but if I find a different form that the framework checkbox will accept then that also fixes the compilation error.

    You can create a new form, set that as the startup object, then enable the application framework, and this is pretty much guaranteed to work. Once you’ve done that, the “startup object” dropdown list is renamed to “startup form”, and it is filtered to what VB considers to be a valid list.

    It turns out that the “Sub New” method in the startup form has to be Public (rather than Friend). That’s the default for new forms, but I’ve been changing that for all of mine in the past, to improve security (“don’t expose any more info than you need to”). Similarly, this Public constructor can’t take any parameters.

  • Event Viewer problems

    I’m currently spending an exciting Friday night in the office. Specifically, I’ve been fixing a Windows 2000 PC that’s been running extremely slowly for the past few days. I’ve got that problem solved now (I’m just sticking around to do general maintenance on it), and I thought it was worth documenting here, in case anyone else encounters it.

    Problem:
    PC running Windows 2000 Pro with SP4 is extremely slow.

    Symptoms:
    services.exe taking 99% or 100% of CPU time.
    Can’t run Event Viewer.
    In Admin Tools | Services, the “Event Log” service says “Starting”.

    Cause:
    One or more of the event viewer log files was corrupt, so the service couldn’t start, and therefore the application couldn’t run. But the service didn’t fail either, it just kept retrying, which meant that it was tying up the whole CPU.

    Solution:
    Change the startup type of that service to “Manual”, then reboot the computer. After rebooting, delete *.evt from C:\WinNT\system32\config (or just move them to a spare folder), and start the service manually. If this works (which it did in this case), it will recreate the three files, and then you should change the service’s startup type back to “Automatic”.

    Further info:
    In this case, two of the three files had a size of 512kb. When the service had restarted, I ran Event Viewer, and looked at the properties for each of the logs. They all had a maximum size of 512kb, and they were also configured to overwrite events after 7 days. I’ve changed this setting to be “Override events as needed”. My theory is that the files got corrupted because Windows tried to add new events, but it had run out of space, and it couldn’t delete the old entries because they were less than 7 days old. Normally this would just give an error message on the screen, but I think it’s best to avoid this configuration in general (I really don’t know why Microsoft made this the default). So, if you’re working on any other machines, take a minute to change this setting over.

  • 70-165: Microsoft Visual Basic 5.0 Programming

    Introduction

    I recently decided to become a Microsoft Certified Professional (MCP), starting with the VB 5 exam. I passed it with a score of 898/1000, which I’m pleased about. I can tell you what I did to prepare for this exam, although I can’t guarantee that the same thing will work for you. I should mention that I’ve been using VB since August 1994 (I taught myself version 3 by reading the supplied manuals), so I wasn’t starting from scratch here. Essentially, I already knew how to use VB (it’s what I do for a living), so I just wanted to know how to pass the exam.

    (more…)