February 2008 - Posts
I won't be blogging for the next week. Tomorrow evening, we are going on a ski vacation! I was invited to join the skicamp my girlfriend is going on with her work. A nice opportunity to brush up my skiing skills. Let's hope we'll come back in one piece, but I'm counting on it ;)
I'll catch you guys later.
Just a quick post: Windows Live SkyDrive is now available. It left the beta stage yesterday. You can now store 5Gb of data online, choose who has access to each folder you create and more. There is a maximum filesize of 50Mb.
Interested? Have a look at http://skydrive.live.com/
In a quick AJAX demo I had to create today, I ran into a (somewhat cryptic) PageRequestManagerServerErrorException. I needed a simple form of the Cascading Dropdown, one that doesn't use a (web)service for its data, but gets it from a simple method. Here's the setup, and the cause...
Lets start with the exact error message:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
I needed 2 DropDownLists working together to enable users to first select a month, and then select a day. Of course, you want the second DropDownList to only display days available for the chosen month. Because of that I had two dropdownlists in an updatepanel, and set the first one to AutoPostback so it would trigger the updatepanel. The first one had items set to something like this: <select item>, January, February, March, and so on. The second one got its items from a method, based on the selected value in the first. This worked like a charm, and all was well. When I wanted to check every scenario, I found that selecting <select item> didn't clear DropDownList2 like I coded it to, but it threw the Exception. What caused this?
When setting items throught the IDE, this HTML is generated:
<asp:ListItem><select item></asp:ListItem>
<asp:ListItem>First item</asp:ListItem>
<asp:ListItem>Second one</asp:ListItem>
Because the value property for the items wasn't set explicitly, it is generated (or should we say substracted?) from the information that was entered. Therefore, the Value property of the first item was '<select item>'. I can imagine how something like that can mess up a JavaScript environment. ;) I opened up the items for the first DropDownList, and set the value properties for each item explicitly (although setting it to a decent value for the first item did the trick). That resulted in this HTML:
<asp:ListItem Value="0"><select item></asp:ListItem>
<asp:ListItem Value="1">First item</asp:ListItem>
<asp:ListItem Value="2">Second one</asp:ListItem>
Notice the Value attribute in the ListItem tag? That's the one that will keep your project from throwing a PageRequestManagerServerErrorException.
With the official release of Visual Studio 2008 coming closer and its release on MSDN last november, there are more and more people asking what the impact of migrating from VS2005 to VS2008 will be and if it will have as big an impact as switching from VS2003 to VS2005 had. The answer is pretty simple: no it won't. Let's see why, and what impact it will have.
VS2003 > VS2005
VS2003 was the development environment for developing applications based on version 1.1 of the .NET framework. With this came a CLR specific to that version of the .NET framework (version 1.1.4322). When Visual Studio 2005 was released, the .NET framework 2.0 came with it. Because of several architectural changes, like for instance Generics, this version of the framework got it's own CLR too (version 2.0.50727.42). Knowing this, it is logical that taking an application that was built for version 1.1 of the framework (and CLR) would have to be modified to be able to run on the new version 2.0.
VS2005 > VS2008
VS2008 is the first member of the Visual Studio family that enables multi-targeting. You can have an application target the 2.0, 3.0 or 3.5 version of the .NET framework. That is pretty different from VS2002 (.NET 1.0) and VS2003 (.NET 1.1) that were bound to their specific versions of the .NET framework. The reason it can do that is the same reason switching from VS2005 to VS2008 will not be too hard: these versions of the .NET framework all use the same version of the CLR (version 2.0.50727.42). Although version 3.5 installs Service Pack 1 for .NET 2.0, which adds some methods and properties required for features like LINQ, these changes do not affect applications written for version 2.0 of the .NET Framework.
Impact
Switching to Visual Studio 2008 will not require you to recode parts of your application, but it does have some implications to switch. VS2008 changes your .sln file, rendering it unreadable for VS2005. The projectfiles however are not touched, or at least not in such a way that VS2005 won't understand them.* The odd one out here is the Web Application Project, which might give some trouble in a multi-VS-development-environment. Have a look at this post at Steven Harman's blog to see how to work around that.
Language features
Working on a .NET 2.0 project from VS2008 does give you quite some extras, next to the fact that the IDE itself has been greatly improved.** A nice example is from someone who posted this question on the MSDN forums:
(..) while creating properties when I used the code-snippet (...), to my surprise VS 2008 created automatic property. (...) I double-checked the target version by opening project properties and it still showed .NET Framework 2.0. I used this new class in the web page, and it worked fine. How is this possible? Is there a bug in VS 2008 and this code will fail if deployed in production where only .NET 2.0 is available, or did I do something wrong?
The thing here is that automatic properties are not so much a feature of the .NET framework, but of the compiler. So go switch to VS2008, and enjoy.
Happy developing!
* TIP: If you need to edit a .NET 2.0 solution from both VS2008 and VS2005, create two different solutions, one for both. This way, you will be able to open the solution from both versions of Visual Studio. Do be advised! When working in VS2008, you might be tempted to use new syntax that won't work in VS2005. ;)
** Found a cool new feature or a nice improvement in Visual Studio 2008? Add it to my list @ Listas!
Until the Zune is available in Europe (when will that be, if ever...), I'm using an iPod. To be honest, I'm pretty satisfied with the product although iTunes still doesn't feel like a solid piece of software... (understatement anyone?)
After lots of hours playtime the original earphones of my iPod died, or at least the right one did. I went through the Apple store and found the 'original' earphones over there. Because of the annoying squeaky sound the cord makes in the inside of the lower part of the earphone, I wanted to try different ones. I ended up choosing the newer (and more expensive!) Apple iPod in-ear headphones.
Some of the features:
- nicer, sleeker design
- no more squeaking
- feels better in the ears
- lousy sound quality!
After having used the new earphones for 3 minutes, I put them back in the box they came in and I haven't touched them since. It might be me, but the sound that came from those earphones didn't even resemble the music they were supposed to be playing. I tried virtually every equalizer setting on my iPod, but none of them could make it better. For now I've switched back to old school earphones that came with my discman (!) years ago. I guess I'll be selecting new ones, again.
There are several steps to creating a custom web service to be hosted in SharePoint. The MSDN library has a walkthrough on creating a custom web service. After having followed this walkthrough thoroughly, I though my web service was good to go. Unfortunately all I saw was an error: "Could not load type 'ThisAndThat' from assembly 'SoAndSo'". Just as I was about to search for an answer somewhere online, I remembered that the MSDN library features the Community content for little over a year now (hooray!).
At the bottom of the walkthrough were some community additions to this specific walkthrough. Some have been incorporated in the main article, others are there to be found for guys (and girls!) like you and I. One of them exactly described my problem. In that same community content item another user had added this comment:
HI - I resolved this issue with a VB.net service by prefixing the class name in the .asmx file with the assembly namespace
And that was it! The WebService works like a charm, hosted in SharePoint. (hooray!)
So there you have it: that's the power of [wikipedia:web 2.0] for you. Users benefit from the fact that they are now able to add to the otherwise pretty static information in something like the MSDN library. ;)