How I fixed Visual Studio crashing when opening XAML (WPF) files
For the second time, Visual Studio 2008 began crashing when double clicking on a XAML file. In this case, the crash was spectacularly underwhelming. No error message, blue screen or other indication of something horrible happing. Visual Studio would simply go a way, or “blink out” as I’ve seen it referred to.
After much searching I was able to determine that the PowerCommands for Visual Studio 2008 extension was somehow involved in the problem. I tried quite a few different solutions including adding a dependantAssembly reference in my Visual Studio configuration, doing a clean solution then rebuilding the project. Up to that point the only thing that worked was uninstalling the extension. Reinstalling afterwards would cause the problem to return.
Working without PowerCommands was an option I did not want to consider. Many times each day I would use functions such as “Open Command Prompt” which fires up cmd.exe starting in the directory of the file or folder selected in the solution explorer or “Open Containing Folder” on a file, just to mention a couple. It was looking like that was going to be the only solution, I was bummed.
I decided to check with the source a bit further. I looked through their issue list and the top voted issue was VS 2008 crashes when adjusting toolbox items. Reading the description did not give me a lot of hope as it dealt with a problem when the toolbox items were adjusted. It also included an actual error which was lacking in my case.
Among the comments to the above issue, I found the suggestion to run the command “ngen /delete *” (without the quotes) from a Visual Studio 2008 command prompt. Ngen is the native image generator which creates native images from managed assemblies and installs a native image cache on a computer, which is a reserved area of the global assembly cache.
Wow, that sounds important, and I’m suppose to delete * (star)? Ok….I was desperate and I did it before investigating what it meant. Dangerous, I know, I know, but as I said I was desperate!
It worked. Nothing seemed to break…and it worked. Ok, off we go! Wait, time to investigate….just in case problems start cropping up later.
Running ngen /? from the command prompt yielded no information, not a mention of the /delete switch. In my experience, when a command line utility fails to mention an argument that clearly did something, this is an argument that should only be used with full knowledge of what it does. Now I started to get nervous!
I did a quick Google Search and was lead to the MSDN documentation for ngen. It seems that my little command deleted all native images in the native image cache. Hmm….that sounds bad. Fortunately, a little further down the page the following information was also present.
This made me feel a little better. The assemblies were still there, simply not the native images for them. Native images simply cause the applications or assemblies to start up a bit faster. With today’s hardware, I don’t know that I’ll even notice a difference, or if I do, it will be worth it to keep PowerCommands and get rid of the problem.
If this behavior resurfaces, I will do a little more investigation by using the /show argument to find out what native images are installed. Then I will started deleting them one at a time to find the culprit. My guess is that one of the native images somehow became corrupted, or the configuration for it got messed up or something like that. Perhaps finding the culprit will aid in the resolution of the issue that this wonderful extension is experiencing by, if the Google results are any indication, a fair number of developers.
Ready to Launch
At Smart Solutions, the company I work for, we’ve been working on a new product for quite some time now. Our target has been a launch in February at the SMX West 2009 conference. We’ve just announced it on our company blog.
Warning…Warning…The Coolest New Product of the Year Announced!
But you’ll have to be at SMX to see it!
Well, that’s not entirely true – you can also see it at www.pixelsilk.com; but you’re going to want to be at SMX to really get to know the geniuses behind this leading-edge…some would say “futuristic”… SEO-enabled Content Management System.
You can read the all the details here. It’s an exciting time and very fulfilling to see the the results of our labor bear fruit. Congratulations to the entire team!
JavaScript == English
I was born and raised in the USA and as such, the English language comes naturally to me. Sure, I see the idiosyncrasies such as 3 words spelled 3 different ways sounding exactly the same (their they’re there), 1 word with multiple meanings (rich, row, tear) or a word spelled the same, pronounced differently and meaning something different (lead, bow, ..) when that is done. Due to these traits, it has been said that English is one of the, if not the, toughest languages to really master in the world if it’s not your native language. (Note: this is a generalization and every situation is different) The basics are easy, but to really grasp the language takes real immersion into the culture.
JavaScript feels the same to me. If your native programming language uses similar concepts (Lisp, Scheme) then you’re probably good, but if you are among the majority coming from a C based language (C++, C#, Java..) you will likely have problems. Sure, the basics are easy, it looks like your C based language, but mastering it can take a lot of time immersing yourself in its culture.
The question becomes this: In today’s web environment, is it worth it to truly master the language? The creator of JavaScript, Brendan Eich, casts his own doubts regarding his creations future:
I don’t really believe ES4 is a demon from the ancient world, of course. I’m afraid the JS-Hobbits are in trouble, though. As things stand today, Silverlight with C# or something akin (pushed via Windows Update) will raze the Shire-web, in spite of Gandalf-crock’s teachings.
Of course the Shire-web he refers to is the current status quo, and Gandalf is clearly Doug Crockford, one of (or perhaps THE) top authority on JavaScript.
My own experience have just recently brought me to an understanding of JavaScript that makes me feel like I finally really get it.
I feel like the <pick your Latin language based country here> who learned enough English when I was young to ask how much my dinner cost, where the bathroom is and to call a cab to get back to my hotel. Finally, moving to the USA, living, working and playing with native English speakers I get the mastery of the language.
Having made that analogy, albeit a stretched one, I think I now have enough information to say, it depends.
What? It depends? I’ve just read this entire piece of junk for a non-answer!?!? Well, yes. Nothing in this life is black and white, or at least very few things are. This includes JavaScript!
I really do think that JS’s multi-paradigm nature means there is no one-true-subset for all to use (whether they like it or not)
I feel JavaScript will of course be around for a long while. While the web does need an overhaul, there are too many people and pages invested in JavaScript to make some grandiose statement that Silverlight, Flash, Air or whatever will replace it. These new, powerful and exciting technologies have found ways to work with JavaScript and it is my belief that the world (wide web) will be a better place for it.
I also believe JavaScript will evolve, kicking and screaming if necessary. I believe it will become more powerful for the programmer. Of course, the problem with evolving JS is browser support and browser saturation. The platforms must support it and people must upgrade. That is the one advantage the other technologies have, at least for the moment.
If you feel you do not have the level of mastery you should have with JavaScript, I suggest immersing yourself with Doug Crockford’s writings. It’s a great place to start. Use jQuery as well since a lot of the examples you find force you to use patterns you may not have already investigated. As with all things, practice and perseverance are the key!
Good luck on your journey, Grasshopper!
Visual Studio 2008 RTM
Microsoft shipped Visual Studio 2008 to manufacturing today. According to some it has become available for download on the MSDN subscriber site, but only the Team Suite edition. Since we do not have the “über” subscription (I believe ours is one step below that) we’ll have to wait for MS to make the professional edition available.
Update: I finally was able to start downloading. Apparently MS decided to use a different distribution method (Akami?) to get over the initial rush, or at least that is my guess on the matter and it is purely my own speculation. The download location was not the normal MSDN subscriber downloads area. In addition, I had to install a new download manager and of course allow popups from msdn2.microsoft.com before I could get it started, but now it’s on is own merry way to my computer! It’s coming down at a good clip too, ,about 570 KB/sec so if things remain as they are I should have it within a couple of hours.
Good luck to anyone else, hopefully grabbing this one
Interfaces, Abstact Classes and Base Classes, oh my!
The discussion came up today, due to a comment of mine, about Interfaces. When should you use them? When should you use a simple base class? I, of course, gave my own opinion on the topic and my team discussed the current project environment to come to a decision on how to proceed.
Afterwards I began doing a bit more research on the subject. One of the articles I ran across was by Mahesh Singh. He put together a very nice overview entitled Abstract Class vs Interface. Essentially it comes down to this question; Will there be shared implementation among inherited classes? His suggestion is that in most cases it is better to use an abstract class. There are a few good comments as well. One reader gives you an exercise which may make things more clear and potentially swing you more towards the need for interfaces, but I’ll leave that up to you.
In the article Interface vs Abstract Class by Maor David he describes some of the differences between interfaces and abstract classes. This article does not try to answer the question of which is better so much as to inform.
It is my opinion that every situation is different. I do not believe either is inherently better than the other; rather, I believe that each is better in certain circumstances. That puts the onus of deciding which road to go down on the developer to decide which suites the condition.
The point that is perhaps more important is to realize that you won’t always get it right. If not, don’t be afraid to refactor! At the same time, don’t be afraid to look at it and say…meh…it’s good enough. The gain for refactoring to use x would not be worth the time it involved.
Version comparison tool for subversion (svn)
Via The Daily Grind I just discovered svn-time-lapse-view. This is a little java utility which allows you to analyze a file from a subversion repository and compare revisions. It gives you a side-by-side view with a slider to scroll through the history showing you the modifications to the file between adjacent versions. Very nice!
There have been many times that I have had to (using TortoiseSVN) select 2 adjacent versions, compare revisions, close the window and go to the next 2 to track down where something in the source changed, was removed or added. This tool, created by Jonathan Aquinio, works as a great time saver for that type of analysis.
Jonathan was apparently inspired by a similar feature in Perforce, although I do not have experience with that tool. Bravo for creating this one!
The Future of Finding Your Way
Robert Scoble was recently ripped to shreds again concerning his recent video. (Note, part II and part III in case you didn’t see them on the site.) I can understand why. His ideas are diametrically opposed to the current business view of finding things today.
I say Bravo. As a developer working with the intricacies, guesswork and sheer superstition surrounded the art of gaining rank with Google, Yahoo and MSN I have been dealing with many frustrations. You see, software engineers like to work in a couple of ways. First, they like to build something. In order to do that, you have to know what you are building. Trying to build pages that work with the algorithms in place today is guesswork at best. Second, we like to break things. We like to get the new gadget, tear it apart to understand it and then put it back together. Once we’ve done that, we know how to build something for it.
Today’s search paradigms do not fit within that mold. It is impossible, no matter what someone tells you, to be certain of what will affect the algorithms in what manner. Want proof? Just look at the great viewstate debate. From tests I’ve seen there is absolutely no evidence that search engines do not like it. In fact, in the test a co-worker of mine performed a page with a huge viewstate ranked highest out of other samples!
So what’s all this about? Maybe a shift in the way we think about finding credible information on the Internet. Finally entering the Circle of Trust. Scoble has some interesting points and let’s face it, this is what he does. He’s been deep into finding the new, better thing for many years now, he must know something! Is he always right? I doubt it. he’d probably admit that as well, but is it worth a listen? Absolutely.
Frankly, I hope he is right. I want to find my way easier, faster and with better success then Google lets me today. I am already starting to believe his hype about Facebook when at first I viewed it as just another “MySpace”. Now even my wife is using it! (Here’s my page if you want me to add you as a friend).
Oh, and check out Mahalo, it’s pretty nice.
Viewstate – Search Engine Update
I’ve been out of town for a bit so I’ve been behind on checking the test Dave has been running. If you haven’t read the original concept, please do so.
Today I noticed that page 4, one with a large viewstate, is showing up #1 at Google. To my knowledge, this is the first time one of the pages has received the #1 spot.
I’m not sure why the other pages are not showing up. Perhaps they are being marked as duplicate content or something, but it is interesting that the page with Viewstate is the one ranking right now.