Wednesday, July 22, 2009

Micosoft Newsfeeds for Visual Studio

After I installed Visual Studio Standard Edition, I noticed that the installer left the newsfeed set to the Visual C# Express newsfeed. I looked around for the proper feed for the regular Visual Studio C# and found this:

MSDN: Visual C#

Other good feeds

MSDN: Visual Studio
MSDN: Visual C# Headlines

Visual C# Express feed

MSDN: Visual C# Express Edition

You can set the feed on the Start Page in Visual Studio by going to Options / Environment / Startup

Tuesday, July 21, 2009

Installed Visual Studio

Now that my computer is somewhat stable, I went ahead and installed the Visual Studio 2008 SP1 Standard Edition that I got on eBay a couple of weeks ago. It runs great so far. I have StyleCop installed and have been using it on a project. I have saved out the default settings that you can get if you ever need them, and have installed my own custom settings. I have used this color scheme for over a decade and it is similar to colors I used in VB 4.0 and Visual C++ 1.0 way way long ago. (Somewhere, I've still got the legendary Visual C++ 1.52c CD).



This setup uses the Consolas font, which is designed for programming environments. You can get it by following the link. It is also included in the ClearType Font Collection. You already have all of these if you have Vista or Office 2007.

Monday, July 20, 2009

Fragile Vista

I don't know what is up with this computer, drivers, or Vista 64 itself, but it has been showing itself to be very fragile and resistant to change. In my other post, I talked about how Vista would get screwed up, such as the Event Log service not working and unable to start, internet access not working, my office VPN not working, unable to connect to the Ghost service running on this computer, and maybe other problems I'm not aware of. Back then, I thought it was due to driver issues, Windows Update, or System Restore, but now I know that is not true. Well, maybe it is true, but there are other scenarios that will screw up this computer in the same way. The last two weeks have been a nightmare of backing up and restoring my system drive over and over trying to make simple changes. First of all, I originally had the system files and our family and personal files all on the same C: drive. To reduce the time to make Ghost images of the C: drive, I decided to partition the Drive 0 into two drives, one 100 GB partition for Windows and applications, and 150 GB for personal files. There is also a 250 GB 2nd drive D: in this computer as well, though I want to keep it empty and only hold temporary files there. So the first task was to copy all of the personal files from the C: to the 2nd D: drive, and retain only system files on the C:. To be able to shrink the drive using Disk Manager, you need to have free space at the end of the drive. So I defragged the C: drive, but unfortunately, Windows has unmovable files, such as the swap file, the hibernate file, and shadow copy files (Restore Points) for System Restore. One can shrink a drive up to the point of one of these unmovable files, but no further. You can get rid of the hibernate files by turning off the hibernating feature using this command:
powercfg -h off
You can get rid of all of the Restore Points by turning off System Restore, and you can get rid of the swap file by disabling virtual memory from the Control Panel. I did all of this, then Windows wants to reboot. Guess what? After rebooting, the system is screwed up. Why? Oh I have a Ghost image I can restore, but only from a week ago. Didn't think to back up before moving all of the personal files and disabling those features. Didn't think I would need to. So I got to start all over. In fact, I got to start over several times. I finally realized that any time I remove the swap file, the system gets screwed up. It is probably something to do with a low-memory condition. But as I say, that is not the only thing that will screw it up. I finally got a stable configuration for the C: drive, including good Ghost backups of the drive on my TeraStation network storage. So, the next thing I wanted to do was to install a new 1 GBit network card to speed up backups even further. I looked at a bunch of vendors and decided on the D-Link DGE-530T because I just love my new D-Link DIR-855 router. This was a huge mistake. I think. After several attempts, I have not been able to get Vista to even SEE that it is installed in the computer. My motherboard does have an onboard LAN connection, so I was sure to disable this in the BIOS before installing the new NIC. The directions say that Vista should see it and then offer to install a driver for it. But nothing I have tried will cause this NIC to be seen, and worse, it screws up my Vista, like all the other changes I make, and I have to restore from a backup... which is on the network... which requires a working network card... which requires the new NIC to be removed... which requires the PC to be powered down... then requires the BIOS to be adjusted again... and the network cable to be reinserted into the original jack... and then rebooting from the Ghost CD... then restoring the backup which takes 1.5 hrs... etc. It is very taxing. When Vista is working, it runs great. But I hate how it can get screwed up. This has been a very long two weeks. Oh, and the D: drive... I am not using Ghost to back up our personal files. I am using XXCopy to make a duplicate image of the file structure on my 1 TB TeraStation, using the command

xxcopy d:\*.* \\ts1\data\Backups\ComputerName /D /M /E /C /F /H /I
/R /K /Y /ZY /YY /EX:c:\Misc\D_Excludes.txt


I have this in a batch file, and the D_Excludes.txt file is empty at the moment. This command will compare the source and destinations for new or deleted files, and will also copy files up that have the Archive file attribute set (the a bit), and will clear the a bit after copying the file. I like this because I have an exact duplicate of the files up on the network storage, whereas Ghost file backups are stored in a proprietary format. Right now, I have 50,122 personal files in 3,530 directories, and with Vista file indexing, it only takes 1:40 for the command to run if there are no files to back up.

Sunday, July 5, 2009

A Painful Lesson

Well, I had an interesting last couple of days with Vista. I learned about how screwed up Vista can get with borked ACL's. It all started Friday morning, when a Windows update alerted me that there was an update for Windows Defender. These are usually lightweight updates that never seem to have any adverse effects. But... I also have an old flaky cable modem, a Linksys BEFCMU10, which is no longer on our ISP's list of supported modems. I have been researching getting this replaced, but haven't made a decision about which modem to go with yet. Anyhoo, I was working at the computer on Fri. morning, when WU asked to install the Defender update, and I told it to go ahead. After it installed, I noticed that my internet quit working and my Norton Ghost icon changed, indicating that it could no longer communicate with the Ghost service. I fiddled with it awhile and concluded that the WU had damaged something that used to work, though I didn't know what. So I decided to just undo the WU by using Windows' ability to Restore from a Restore Point, which the WU created as it was installing. Reboot, and no problem, right? Wrong. After the computer rebooted, the internet still didn't work, Ghost was still unhappy, and not only that, I found that my VPN network icon no longer worked, giving Access Denied when I clicked on it. I had just been using the VPN prior to the WU. Not good. Digging deeper, I learned that the Event Log service was not running, and would fail immediately when I would try to start it. That is very bad, as the Event Log is where error information is supposed to go. What to do? I googled the error message I was getting from trying to start the Event Log service, which was
Error 4201: The instance name passed was not recognized as valid by a WMI data provider
Forum threads such as this Microsoft Technet one indicated that it was a permissions problem on certain folders or files, or else it was an ACL problem. I tried a few things with permissions, but nothing was helping. The suggested ACL fixes are complicated and may not have worked anyway. So, I decided to just restore that whole computer from a backup. I just happened to have a 2-day old Ghost backup image of the drive, so that was good to restore from. Trouble is, it is on my Buffalo Terastation NAS drive, and I only have a 100 mbit NIC in this computer. When I booted up from the Ghost CD, it started to do a verify of the image before the restore. It estimated 15 hours... yowzer. Well, we were leaving for the 4th of July weekend anyway, so I just turned off the monitor and left for vacation. There is a checkbox in Ghost to tell it to reboot when it is done restoring, and I told it to go ahead, expecting that when I returned, I would see the usual login screen and everything would be fixed. But guess what? When I got back late last not, the problem was STILL THERE. WHAT?!!! This problem was NOT there when I made the backup on Wednesday. What's going on? Oh... did I mention that I also have a RAMDisk, and I have all of our temp directories pointed there, along with all of the browser cache files going there? When I upgraded to Vista 64, Superspeed required that I get a new license for Vista. It is not a license that you can get immediately. You have to send them an email, then they respond back with the key. In the meantime, you can run the software in trial mode for 30 days, at which time it expires and quits working. Here is the genesis of my trouble: I neglected to update the license key for the RAMDisk and it quit working right at the end of June. Therefore, the temp file locations were no longer valid because the drive was no longer there. Now here is the 1st lesson that I learned about Vista: If you boot up your computer with the temp file location unavailable, the Event Log service will not start up, and all sorts of other nasty inexplicable problems crop up. I noticed that this was a problem, but unfortunately, the Ghost image was not created with the RAMDisk license info installed. What I decided to try, and really hoped would work, was to predate the computer to mid-June, before restoring the backup. That way, when the computer booted up, it will think it was June and the RAMDisk would be active, thus having a valid temp file location. I also disconnected the computer from the internet, in case Vista would try to fix the time using a time server. To speed things up, I copied the network Ghost image to the D: drive on the computer, and restored from there. Then crossed my fingers. I was happy to find that this worked perfectly, and I now have a fully functioning Vista again. Oh... and the original internet problem... It was not WU at all, it was the stupid cable modem, and only needed to reset it to make it work again. The 2nd thing I learned was: Don't procrastinate on entering license keys. The 3rd thing: Norton Ghost is worth its price in times like this.

Wednesday, July 1, 2009

New Router

Yesterday, a new router was delivered to our home. I bought this D-Link DIR-855 Wireless-N gigabit router on eBay a couple of weeks ago. I was a little hesitant to get Wireless-N because the standard still hasn't been finalized. However, I have been wanting a gigabit router and we've been having weak signal problems with our wireless laptops upstairs. So, after some research, I decided on this dualband D-Link.



It replaces our old trusty Linksys WRT54GS Wireless-G router. It has worked great for years, but now it is time to retire it, partly because it is only 100 mbit.



Another nice feature of the new router is the ability to schedule the wireless access. When school starts, I want to block wireless access after bedtime.

Tuesday, June 30, 2009

Ghostnet Botnet in Action

One of the reasons we upgraded to Vista from XP is for increased security from malware. Here is a video showing one example of what the bad guys can do with your computer once it has been compromised. If you have never seen anything like this before, prepare to be shocked. It is an example of the Ghostnet botnet.

Sunday, June 28, 2009

Got VS.NET on eBay

I just won an auction on eBay for Visual Studio 2008 Standard Edition, got it for $61, and I also redeemed an eBay 8% off promo coupon, so the final price was $56.12, with free shipping. Very cool.

I Want to Buy Visual Studio

Well, I have been using Visual Studio Express at home for a couple of years now, but I think it is time to buy it. The reason is because the Express versions do not support tools. The three main tools I am interested in right now are Resharper, StyleCop, and NUnit. I went to Microsoft's comparison page to compare pricing. Cheap that I am, I will go with the Standard edition, which is listed at $299. But I see that I qualify for the Renew option, at $199. From the page,
To qualify for upgrade pricing, you must be a licensed user of an earlier version of Microsoft Visual Studio or any other developer tool (including free developer tools, such as Visual Studio Express Editions or Eclipse).
Well, I'm using Visual Studio Express, so I guess I qualify.

Thursday, June 25, 2009

StyleCop Is Usable

With the discovery of the context menu invocation of StyleCop, I am able to do what I have wanted all along, which is to run the tool on only one of our 60 projects and not have any affect on the other 4 developers in my group.

Wednesday, June 24, 2009

StyleCop with a Single File

A few minutes (!) after posting my previous post, I learned that there is indeed a StyleCop option added to the right-click context menu for running StyleCop on a file, project, or the solution.



Running StyleCop from the Tools menu, however, always runs it on the solution. Maybe this will be usable after all... I'll play with it tomorrow.

StyleCop and Legacy Code

Like so many Microsoft tools, they always seem to provide you with about 90% of what you need, and the 10% they don't is very frustrating. When you run the StyleCop install, it will insert a tool in the Visual Studio Tools menu, which you can run at any time.



I installed it today and note these problems:
  • In Visual Studio, the tool ignores what you currently have selected and processes the WHOLE solution. That's ridiculous. Microsoft knew that the first attempt at using this tool would produce thousands of warnings. You would think they would realize that the average person would want to run this on a single file only. Not a solution with 60 projects and hundreds of source files. Sheesh. What I would like is this: If I have a file selected, run the tool on that file. If I have a project selected, run the tool on that project. If I have the solution selected, run the tool on the whole solution. This isn't rocket science.
  • They provide a way to bypass certain projects or files by letting you modify the .csproj file. They even provide a utility to do this for you. But guess what, when you run the tool in Visual Studio it IGNORES these settings. GOOD GRIEF.
  • There is no standalone tool. The tool must be integrated into Visual Studio and/or MSBuild.
  • The only way to selectively run StyleCop and have it honor the project exclusion settings is to do a build. But to do that, you have to integrate the tool into MSBuild. When you do that in a shared environment, everyone has to install and configure StyleCop, even if they don't use it, otherwise they will not be able to build on their machines. Yes, they do provide a hack for team development, but this requires that StyleCop files be checked-in to source countrol along with your source. Ick.

Someone at work suggested that I create a new solution with just the project of interest. The problem is that the project has dependencies on other projects in the solution, using project dependencies, not file dependencies. If I start adding in all the dependent projects, I'm back to my original problem of thousands of warnings for source files that I am not interested in right now.

I did all this at work today. I am not sure that I want to or can continue with it. I may just do an Undo-checkout and throw it all away. In short, it is a good 90% solution, but the last 10% could be a show-stopper. And that's too bad.

Website for File Hosting

This blog will be my primary website. But I need a place to park files for downloading, so I just created a new personal Google site for free. I'll be putting programming projects over there and linking to them from here.

FeedJIT Trouble

I've been having trouble with the FeedJIT Live Traffic Feed on IE 8. If the page crashes, try reloading it.

Tuesday, June 23, 2009

StyleCop

Grrrr... I want to play with StyleCop but it is not supported with Visual Studio Express and there is no standalone version.

Thursday, June 18, 2009

Programming Haiku

From a tshirt given away to attendees of an MSDN event...



I solve some of my toughest programming problems in the shower...

Tuesday, June 16, 2009

Made the Move to Vista 64

I recently upgraded our home computer from Windows XP to Vista 64 Home Premium. I had been waiting for about 2 years, I suppose, to make the switch. A few years ago when I bought our computer, I chose an Athlon, hoping that someday I would actually get a 64-bit OS. Recently, I decided with all the buzz about Windows 7 it was time to get going on it. So I went out on eBay and got an OEM copy of Vista for $100. The OEM version will not do an upgrade of an existing Windows installation. I thought that the install would perhaps format the drive, but actually it just layed the bits down on what was already there. I had a spare drive that I used for the OS, and I removed the original XP drive for safe-keeping, just in case something went terribly wrong. Before the switch I exported all of our Live Mail and contacts to a NAS drive, then imported them later. I had no problems whatsoever, except that I forgot about all of my Message Rules. I have to say that I am very happy with the OS so far. We have had Vista 32 on a laptop for a couple of years now and it is awful - just too darned slow. But for all of the negative press Vista has gotten about being slow, the 64-bit OS is noticeably faster than 32-bit XP on this same hardware. I did not even consider installing the Win7 RC because there is no official upgrade path from the RC to the RTM. Microsoft really scr*wed people with the .NET 1.0 Framework RC when it went RTM back in 2002. The only officially supported upgrade to the RTM was to reformat the harddrive. Didn't want that with Win7! There were two problems that I have been dealing with, one of which I've resolved, the other not yet. After I upgraded, I had used the DVD drive to install MS Office. That was about a week ago. The night before last I went to rip a CD and I noticed that Vista wasn't showing my LiteOn DVD or CDROM drives. I hadn't used them since then, so I don't know when the problem first happened. I went into Device Mgr. and there were yellow warning triangles for these devices. I uninstalled the two drives and reinstalled them, but they did not repair. After googling the problem, I found that iTunes and some DVD burning software may install some drivers that break Vista. I was happy to find that upgraded GEAR Drivers fixed my problem. The install works for both 32 and 64-bit versions of XP and Vista. My second problem is that our Brother MFC-6800 printer has no Vista printer driver. It absolutely will not print from Vista, and if I try, not only will it not print, but no other print jobs from our other computers will print either until we turn the printer off and back on again. Other than this last glitch the upgrade has been great. Last night I installed Vista SP2. The upgrade went without problem, though it took about 45 min. to run.