If you have used Visual Studio 2005 for any length of time, particularly if you have installed the .NET 3.0 bits in either Beta or Release form, you may have suddenly seen some or all of your project templates in the New Project dialog disappear!

I wrote about this and a related issue before but this time around the fix was not so simple. I had installed the WWF and WCF bits along with the .NET 3.0 SDK. Somewhere in the process I lost the Windows Application template for VB.NET.

This lead me to try a number of potential fixes outlined in this blog post on Eric Hammersley's blog. None of the fixes outlined there helped. Neither did uninstalling and reinstalling Visual Studio itself. I also uninstalled the 3.0 bits, all add-ins, etc.

So I started doing some digging, the way the templates, at least the stock ones, seem to work is that there is a series of directories in this folder: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

The ones of interest are: ProjectTemplates, ProjectTemplatesCache, ItemTemplates, ItemTemplatesCache.

The Templates directories contain the "Master" copies, the Cache versions of the folders contain the copies that are displayed in the New Project or Add Item dialog boxes. They are normally identical.

The command devenv /InstallVSTemplates run from a Visual Studio command prompt should sync the directories up. But this had not happened on my system. Repeated execution of the command resulted in no change.

Then I began to wonder, after all I am running Vista, even though I had made my account a member of the Administrators group to resolve this issue (not recommended by the way), I remembered that on Vista that was actually only making me an "almost" administrator.

So I logged in as the real administrator account, opened a Visual Studio Command Prompt and executed the devenv /InstallVSTemplates command and this time the hard drive lit up and there was a perceptible delay before the command prompt reappeared.

I logged out, logged back in as my own account and launched Visual Studio and the templates were back again!

Further spelunking in the Application event log showed that about two days before Visual Studio had started to complain that my cache directories were not in sync, and that several templates were missing their templatename.vstemplate files.

Templates are a basically zip files which include a vstemplate file that captures the references and directory structure of the template when it is expanded and created. Something had corrupted the cache copies and apparently I did not have enough rights to copy the originals over top of the cache copies.

More disturbing was that reinstalling Visual Studio did not fix the issue! But whatever the reason the files became damaged, logging in as administrator resolved the issue.

Hope this helps someone else!

Cheers,

Robert Porter

UPDATE: I forgot to mention, don't try just copying the directories from the master copies into the cache folders. There is more involved than a simple copy operation and if you just physically copy the files you will lose ALL of your templates. I know, I tried.


 
February 24, 2007
@ 09:34 PM

I have been a user of AvantGo for several years, and until recently I was a paid user. Meaning I had paid ~$20.00 a year to extend the free subscription channel size of 2000K to 8000K.

For those of you that have not heard of AvantGo it is a web based service that allows you to subscribe to "channels" that it provides of web based content. This content is specially rendered to be easily readable on mobile devices like Palm hand held's, Windows Mobile devices and some cell phones. You download a special client onto your mobile device, select the channels you want from a list of many hundred, sync your device and Bob's your Uncle, there you go, content to go!

The custom browser they provide allows for on or off line use. So you can read content offline (my favorite time to use it was in the bathroom for those extended sit down appointments), or online if you have connectivity for your device.

At the time I first subscribed to AvantGo it was about the only game in town. RSS had not really hit the mainstream yet, and offline content browsers were in their infancy. But now with RSS readers available for just about every device made, and with content now available via RSS for everything under the sun, AvantGo is decidedly not the only game in town anymore.

And it is showing it's age. 3 of 4 sync attempts lately ended with errors requiring me to re-sync and sometimes re-enter my credentials. And they removed the ability for Windows Mobile devices using ActiveSync from syncing automatically.

Their lame reason was that ActiveSync syncs almost non-stop, (it does), and the devices were swamping their bandwidth. So rather than figure out a way to have the client software account for this behavior they decided to make all Windows Mobile users manually sync.

This time around when it came time to renew I elected not to. I let my membership revert back to the standard 2000K channel limitation. Interestingly enough the email I received from them informing me my subscription was about to expire required me to visit their web page and make the choice there. Otherwise I would not be able to sync with the service.

I thought hey, this is a great way for them to collect feedback from users that are either renewing their subscription or not! But instead all I could do was select renew, or push a button that said I was acknowledging that I was no longer a "Power User".

So rather than even attempt to ask why I had not elected to renew they just let me not renew. Fairly short sighted customer retention policy if you ask me. It would have been nice to have at least had the option to explain why I was not renewing and if I had any suggestions for improvement etc.

I did take the extra step of going to their Contact Us page on their web site. That is pretty much useless as well. I saw no contact option for customer service or feedback. Just a fairly terse couple of sales contacts and support contact options.

Ah well, if that's how they take care of their customer base then they deserve to die a slow death of attrition.

Cheers,

Robert Porter


 
Categories: Reviews | Tools and Toys | Windows Mobile


February 24, 2007
@ 05:29 PM

When I first looked at Koders I was unimpressed. The idea was great, a search engine that specifically searched source code. And presented it's findings in a more consumable fashion than standard search engines.

Here is an example of a search in both Google and Koders to show the difference.

Koders

Search terms used: smtp attachments 
Filter: VB.NET

 

The search was potentially for code showing how to create SMTP attachments using VB.NET. The search actually returned only 1 result. And according to its own stats took about 1.52 seconds

 

 

This result was as shown below:

 

 

 

 

 

 

 

Clicking on the link below the item took me to the code in question, displayed as code, with syntax highlighting etc. While the results were certainly paltry, they were on target.

 

Google

Search terms used: vb.net smtp attachments

 

 

 

This search returned 197,000 results in, according to their own stats, 0.13 seconds

 

 

This result is shown below:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clicking on any of the links took me to pages that were varied in terms of their formatting etc, but the results were valid. The second result returned was exactly what I was looking for.

My original complaint with Koders was and remains that it is Java centric, the depth of code for other platforms, specifically .NET is limited even though Google and Windows Live both manage to find plenty of code in just about any platform or language. I like Koders format and potential but until they can figure out how to make the coverage deeper and wider I will still use Google as my primary search tool for code.

But I will keep checking back!

Cheers,

Robert Porter


 
Categories:


Why do software companies continue to tie software keys, licenses etc to email addresses? Most people have multiple email addresses, and they tend to be perishable and short lived.

I use a service called Pobox.com that addresses some of the issues. It allows me to have an address like myname@pobox.com which I can give out to anyone, and then I tell the service what actual email address or addresses I want the mail forwarded to. They also offer a number of other services such as rules you can apply to incoming email, spam filtering and scoring, and you can even use your own domain. Check em out!

But while this helps, I don't always want to give this address out to vendors. So I often use a throwaway address like me@yahoo.com or some other email address I don't mind getting spammed into oblivion.

Yet vendors want to use our email address to identify us. I can't tell you how many products I still use that were originally licensed to me via an old work specific email address. And invariably when it comes time for an upgrade and I have to retrieve my license details I have to enter the email address I used when I purchased the software.

Sometimes they even send the license or upgrade details only to the email address you used when you purchased the software. And on the rare times I have tried to convince a vendor that they should change my email address in their records it usually results in my account being forever irretrievable even by the vendor! sigh.

In fact a fair number of vendors appear to use your email address as an input into their key generation routines.

An email address is a poor identifier, yet its use as an identifier is prevalent. We need a better method for identifying ourselves electronically. I have been reading about OpenID lately and of all the attempts I have seen in the past (Passport anyone?) it seems to have the most promise. As far as I can tell the organization is not owned or unduly influenced by any particular vendor. And it does appear to be a truly open standard. 

We need something other than email addresses, perhaps this is it?

Cheers,

Robert Porter


 
Categories: Rant


Microsoft has release SQL Server 2005 SP2 as of yesterday February 19, 2007. The list of bug fixes contained in SP2 are detailed KB921896. The readme for the service pack is here, and the Service Pack download page is here.

Microsoft Virtual PC 2007 is a free download and is fully Vista compatible, as both a quest or host OS. I downloaded and installed it and it ran all my existing 2004 VM's with no problems, I did however update the Virtual Machine Extensions in all the existing VM's.

You can download Virtual PC 2007 here.

Happy downloading!

Robert Porter


 
Categories: SQL | Tools and Toys


February 19, 2007
@ 12:33 PM

Upon some further investigation, the built in configuration options for managing all kinds of settings, environment options, shortcuts etc, are extensive and fairly easy to use.

From the Tools Menu select Import and Export Settings. In Visual Studio 2005 this brings up a dialog that allows you to:

  • Export your current settings (all or some of them) to a file.
  • Import predefined settings packages, or a previously saved set (all or some of them)
  • Reset all Settings. (Use this one to start over from one of the predefined packages.)

If you select Import selected environment settings, and then click next you get another dialog that gives you the opportunity to save your existing settings to a file, or just import new settings and overwrite your existing ones.

I selected the second option. This brings you to yet another dialog, this one containing the list of predefined sets of settings. The list available will vary depending on what edition you have and what server technologies you have installed, e.g. SQL Server.

Select one of those offered, and then hit next. (You can also browse for a saved package or file someone else sent you etc.)

On this next dialog, you will see a tree view control with three main nodes called:

  • General Settings
  • Help Filters and Favorites
  • Options

Clear all of them by selecting the All Settings node, then you can expand each of the nodes and subnodes in the tree view to see what is available for you to import. Watch out for the settings with the little Yellow Exclamation point symbol next to them. Changing these settings according to the explanatory text could "compromise" your development environment.

I imagine some of these settings are mutually exclusive or cross dependant on other settings. So be forewarned. However there is always the option to Reset All again!

Cheers,

Robert Porter


 
Categories: Programming | Visual Studio


In my previous post about the New Project Dialog box I mentioned that I had selected General Development as my answer to what kind of development environment did I want.

I wondered exactly what that did to my keyboard shortcuts and other environmental settings, other than the obvious of giving me back my full featured New Project Dialog box.

A little digging yielded the following link: Shortcut Keys which takes you to an MSDN page that

discusses the effects of all the various predefined key bindings. It also has some excellent information on creating your own bindings etc.

Still, I have not found the magic setting that lets me have the key bindings I want (VB) and have my New Project Dialog and other environment settings the way I like them, but I think this link is a good starting point.

Weigh in if you have any suggestions of further information.

Cheers,

Robert Porter


 
Categories: Programming | Visual Studio


I was recently using the old standby NorthWind database that has been a stock example database with SQL Server for a long time. It is no longer distributed with SQL Server 2005 but you can download updated scripts that will create and populate the database on SQL Server 2005. If you want them they can be downloaded here along with the companion pubs database as well. Don't let the title fool you, these scripts are 2005 aware even though the download page says 2000.

 

I have used the same or similar code to retrieve images stored in SQL server for a long while without issue but now I was getting errors retrieving the photo data.

Here is the code I was using:

 

        For Each row As DataGridViewRow In Me.dgvEmployees.SelectedRows

 

            Dim Emp As Employees = TryCast(row.DataBoundItem, Employees)

 

            If Not Emp Is Nothing Then

                Dim imageData() As Byte = CType(Emp.Photo, Byte())

                Dim msTemp As New MemoryStream

 

                msTemp.Write(imageData, 0, imageData.Length)

                Dim img As Image = Image.FromStream(msTemp)

                picEmployee.Image = img

            End If

 

            m_CurrentEmployeeID = CType(row.Cells(0).Value, Long)

            lblEmployeeID.Text = m_CurrentEmployeeID.ToString

 

        Next

The code was failing with an "Invalid Parameter" error on the line containing msTemp.Write

After some serious head scratching, and a little Google work I stumbled on this article on Visual Studio Magazines site. The article had a paragraph at the bottom that explained the mystery:

Notice a subtlety in this code that is particular of the Northwind database but has no relevance in general. The original Access database was converted into SQL Server's Northwind database, so the image field called Photo doesn't contain a true GIF file; instead it contains the OLE object that Access builds to wrap any image. As a result, the stream of bytes you read from the field is prefixed with a header you must strip off to get the bits of the image. Such a header is variable-length and also depends on the length of the originally imported file's name. For Northwind, the length of this offset is 78 bytes.

I changed my code to take that 78 byte header into account as follows and everything worked as it should have!

 

For Each row As DataGridViewRow In Me.dgvEmployees.SelectedRows

 

            Dim Emp As Employees = TryCast(row.DataBoundItem, Employees)

 

            If Not Emp Is Nothing Then

                Dim imageData() As Byte = CType(Emp.Photo, Byte())

                Dim msTemp As New MemoryStream

                'note the image data in Northwinds contains a 78 byte header

                'that needs to be stripped off.

                msTemp.Write(imageData, 78, imageData.Length - 78)

                Dim img As Image = Image.FromStream(msTemp)

                picEmployee.Image = img

            End If

 

            m_CurrentEmployeeID = CType(row.Cells(0).Value, Long)

            lblEmployeeID.Text = m_CurrentEmployeeID.ToString

 

        Next

Hopefully this will help the next person to stumble upon this historical oddity!

Cheers,

Robert Porter


 
Categories: Programming | SQL


I recently rebuilt my system, something not unusual for developers. In my case it is at least once every quarter. There is even an industry buzzword for it, re-paving, and it is appropriate as you are in essence taking a work surface that has become potholed and rough, and laying a brand new surface (your OS and applications over top of it).

But in my case the real pain started after I was done. During setup I happened to install SQL Server 2005 first this time, before Visual Studio. Apparently as a result of this a number of strange things happened to Visual Studio's default settings. For one thing, my help collection defaulted to SQL Server, for another I never got the Visual Studio "What kind of developer are you dialog" during install.

But most frustrating of all was the anemic looking New Project Dialog box that now appeared. (Click on the image for a larger version. Notice that there are almost no options, especially as applies to where you want to save a project or if you want a solution created, or if you want to add the project to SourceSafe!!!

Auugghhh! I searched high and low in the various options dialogs and on the web. I found all kinds of information on creating custom templates and repairing damaged templates. But nothing that would indicate how to restore the now missing functionality for the New Project template. However while I was searching for this information I stumbled on to the blog entry on Eric Hammersley's blog, called Missing an item template in Visual Studio 2005? Try this... buried in the comments was an answer to my other mystery, why was my help being pre-filtered for SQL Server?

The comment suggested that you go to Tools | Import and Export Settings | Reset all settings.

Then select your preferred developer type. In my case I selected General Development Settings from the list and Oy! All was right in my world again!

I once again had a full fledged New Project Dialog!! And my help was restored to the correct standard collections!

Ah, life was again good! Here is a shot of the IMHO "good" New project dialog box, again click the image for a larger copy. As you can see it shows the options that were missing.

Some experimentation yielded the fact that the Visual Basic Developer settings generated the anemic dialog. I guess Microsoft thinks VB developers can't handle the real stuff? Anyway, I am back to where I wanted to be. I hope this helps someone else.

Cheers,

Robert Porter


 
Categories: .NET | Programming | VB.NET | Visual Studio


This is very interesting! A scrollable web based timeline for data. The SIMILE project describes it as:

Timeline is a DHTML-based AJAXy widget for visualizing time-based events. It is like Google Maps for time-based information.

You can take a peek at their example of it here, I stumbled across it by reading the recent email on the dasBlog email list. Some of the blogger's on the list think it would make a unique way to present blog posts! And I agree, but apparently there are some serious performance issues with large datasets.

But it is an interesting concept and I am willing to bet that with the dasBlog folks looking at it there will be a resolution to the performance issue!

Cheers,

Robert Porter

Update: Scott Hanselman just blogged about this as well, take a look here.


 
Categories:


February 15, 2007
@ 09:13 PM

I just opened my browser and tried to go to Windows Live, and received the following:

Other web sites are working fine, did Live die?


 
Categories: Browser | Misc


February 15, 2007
@ 09:08 PM

There are a number of references floating around the Internet about how to use an upgrade version of Vista to actually perform a clean install. I am not going to recap the steps here but a simple Windows Live query will yield the steps.

But I did actually use the method, and it works. In my case I really was upgrading in the sense my system had a legitimate version of XP Pro on it when I bought it, and I therefor was qualified for the upgrade price. Since the process allows a clean install as opposed to an upgrade in place it was very attractive to me.

Upgrading an OS is always a rather tricky business and invariably leaves a lot of extraneous "crud" from the previous OS laying around your hard drive and registry. So when possible I always prefer to do a clean install and start fresh.

So I used the "trick" that is being circulated to perform a clean install with an upgrade only version. I believe since I did in fact have a full valid license to XP that I am not violating the spirit of the license even if I am technically in violation.

That being said I would not condone someone installing an upgrade version unless they were qualified to do so in accordance with the intent of the license agreement. I have heard many folks make the argument that since the installer allows it to happen, it must somehow be ok.

Sorry, I don't buy that argument. If you have a licensed OS that is allowed to be upgraded, and you are in fact upgrading that system then you qualify for the upgrade price. Otherwise you should pay full price. Its fairly black and white, I don't see any gray anywhere in there.

Now is Vista, whatever version, worth the price? The market will decide that.

Cheers,

Robert Porter


 
Categories: Misc | Ramblings | Rant


February 15, 2007
@ 07:12 PM

I know this is old, but I giggle every time I see it!

 

 


 
Categories: Misc


Intel recently announced that they had developed a research prototype processor that can perform calculations at the rate of more than one trillion floating point operations per second. While consuming about the same amount of power as a light bulb!

That's a lot of calculation horsepower. The prototype is an 80 core chip about the size of human fingernail. The last attempt to attain this speed was in 1996 when the ASCI Red computer benchmarked a calculation rate of one teraflop. ASCI was a system that used 10,000 Pentium Pro processors and consumed 500kW of power and another 500kW of power to cool the room it was in!

The Intel press release and related information is available here and contains a lot of interesting information including the prediction that this type of computing horsepower may well be available on our desktops within a decade.

Which makes me boggle, and scares me a little. With advances like this in sheer brute force computing power cracking encryption keys will become much easier! We were more or less safe from brute force attacks against encryption keys and hashes because the computing horsepower required to crack them was impractical to assemble.

But with chips like these available, I sure hope the Crypto folks are thinking about a whole new approach! Don't misunderstand, I think the benefits of this breakthrough are potentially amazing, but all technology can and has been used for both good and evil.  And this is the equivalent of the digital nuclear bomb!

Well, as someone once said, you cannot put the genie back in the bottle!

Cheers,

Robert Porter


 
Categories: Programming | Security


February 15, 2007
@ 01:44 PM

Well, as I mentioned in an earlier post Vista, Typed Datasets and Other Stuff, I was hesitant to adopt Vista due to known incompatibilities with some of the tools I use. Well that was before I had access to someone at Microsoft that had all the answers!

I am now happily running Vista Business Edition on my laptop and all of my development tools work just fine!  I took the rather extreme pre-caution of moving my previous laptop OS and all into a Virtual Machine first!

However my experience to date has been wonderful! I love the new Aero interface, and my system is actually more responsive then before I upgraded. Of course that's probably as much a function or essentially re-paving my laptop as anything inherently faster about Vista.

There are still some issues. Visual Studio 2003 is officially not supported, however Visual Studio 2005 and of all things Visual Basic 6.0 are supported! There is even a CTP release of a Visual Studio Service Pack specifically for Vista.

The release notes for the service pack are here and the service pack itself can be downloaded from here. This is meant to be applied after the standard SP1 has been applied to Visual Studio.

In order to be able to continue to work with Visual Studio 2003 and in order to avoid installing VB6 on my primary development system I created a new Virtual Machine using Microsoft Virtual PC 2007. This VM runs Windows XP with Service Pack 2 and is kept current with all Microsoft Service Packs and Updates and has it's own copy of Anti-virus and other tools and utilities. Additionally I installed Visual Studio 2003 and VB6 and all the associated add-ons and documentation and tools and utilities I normally use.

Now I have a complete fully functional (and peppy!) development environment in a box! Complete with Internet access, Source Control, and all the rest of the things we all take for granted in a development environment.

The result is I have two, segregated, development environments, one for legacy app's and support and one for all my current work! Each environment is cleaner and leaner than if I had everything installed on one system.

And the learning curve for Vista was not all that great I was pleased to discover, it actually is more intuitive in many ways, and things were where they "should" be. The only application I could not get working in Vista (but it is working fine in the XP based VM) was PGP Desktop.

In conclusion I am very happy with my system and the performance and stability of Vista in general. And the eye candy of Aero is just frosting on the cake!

Cheers,

Robert Porter


 
Categories: .NET | Programming | Reviews


I have and love a PPC phone. It's a PPC6700 and runs Windows Mobile 5. Microsoft recently released a new tool that makes me love my phone even more!

Windows Live Search for Mobile just added a whole new dimension to my mobile experience. In and of itself it has justified the data package I have bought!

It brings localized search to your hand held! It works for either Java or WM powered devices so it's not an Microsoft only offering.

It supports scrollable, zoomable maps, driving directions, address look ups, business lookups, SMS capabilities pretty much everything search related.

But it gets better! I recently had need to meet a friend after work and was not familiar with the establishment or it's location.

A quick search yielded me the address and phone number (linked so I could click on it to make the call) and a map and driving directions!

This is the default starting page on my phone. I had already selected Raleigh, NC as my local area. Then I typed "playmakers" without the quotes, into the search bar and received the following listings. The first listing was the correct one.

Notice that the phone number is a clickable link! Clicking it dialed the number for me!

Also notice that it showed me a rough distance estimate. 3.36 miles.

I decided that I wanted the map and selected map from the menu and voila!

 

 

Here is the map I received, in just 2 -3 seconds!

 I could (and did) zoom in, click and drag the map around with my stylus, and switch to turn by turn text directions.

All in all a wonderful enabling technology! Run, don't walk, to your mobile browser and download this small application now!

The direct download link for your mobile phone is:

http://wls.live.com

The JME2 version for both the US and UK is also available there.

The application is GPS aware and works with some built in GPS's and almost all external GPS devices provided they can be configured to talk on a COM port.

 

 

Happy Mobile Searching!

Bob Porter


 
Categories: Browser | Reviews | Tools and Toys | Windows Mobile | Mobile