.Net 3.5 SP1 "breaking" changes

There have been a number of posts about the changes introduced in .Net 3.5 SP1, but this is one I've not seen before.  I'm not sure that the title, "breaking changes" is entirely correct, but it probably got your attention :)

In .Net 3.0, there was a new class, System.Collections.ObjectModel.ObservableCollection<T> (I'm sure you can guess what it does).  It had two constructors, ObservableCollection<T>() and ObservableCollection<T>(List<T>).  Clearly the guy who wrote it was having a bad day - List<T> as a constructor parameter?  What's all that about?

This stayed the same in .Net 3.5, but changed with .Net 3.5 SP1.  Now, ObservableCollection<T> has an additional constructor, ObservableCollection<T>(IEnumerable<T>) - i.e., the one that they should have had in the first place instead of List<T>.  All is good in the world.

Now there's a nice feature in VS2008 whereby you can indicate in the project properties which version of .Net you are building for.  This means that VS makes sane choices as to which assemblies you can reference, meaning that the code you write should run just fine on a machine that's only got old versions of the framework, even if you've got all the latest spanky stuff installed.  (There's another issue to do with the compiler, but I'll cover that in another blog).

Here's the problem.  If you have .Net 3.5 SP1 installed, and you create a project that targets 3.0, VS will happily only add 3.0 references.  Including the reference to the assembly (WindowsBase, if you care) that contains ObservableCollection<T>.  Which SP1 upgraded. So you can write code that takes advantage of the new constructor, such as:

ObservableCollection<int> x = new ObservableCollection<int>(new int[] { 1, 2 });

which will compile and run just fine.

When you finally complete all your coding and have all your tests passing, you pass it to your customer confident in the knowledge that you've done a good job.  He installs and runs the code, and the very first impression he gets of your work is a MethodNotFound exception, since you're calling a constructor that he doesn't have on his machine.

So what do you do?  There's not much you can do on your development system, other than be careful, which isn't much help.  What you can, and should, do is to make sure that your build server and test environments exactly match the minimum that you expect your code to be running on.  That way, a problem like the one above will get spotted during the development process where it can be easily fixed.  Note that it's probably a good idea to turn off automatic updates on build & test machines, otherwise you'll probably end up getting stuff pushed down that you didn't want.

Update: Turns out that there's a Code Analysis rule that checks for this sort of thing, so that's a great help - make sure you've got code analysis enabled, and it then pops up as a warning. At least with this, the developer gets some notification that he may be doing bad things.

Comments

# hugehomemadeporn.info
Gravatar We have all sorts for you to choose from whether they are looking for friendship or wanting horny guys to show them a good time.
Left by hugehomemadeporn.info on 3/30/2009 2:50 PM
# Fetish sex
Gravatar Horny Tokyo teen goes into wild orgy with three adult males. She never had experience with such large number of penises but she will manage to suck and fuck them hard. These males will also be hard on her in order to trash those tight and deep holes she has!
Left by Fetish sex on 4/3/2009 4:58 PM
# redmilf.info
Gravatar If this is true, this may be the hottest sex tape to ever make the celebrity rounds. So far, the only information on a possible tape involves the couple“ hooking up” in the wine cellar at New York’ s Philippe. The restaurant has security cameras to protect the expensive liquors, which clearly Tom and Gisele were unaware existed. The restaurant is saying all tapes are kept off the premises and then erased, but rumor has it employees viewed the little love fest.
Left by redmilf.info on 4/6/2009 12:33 PM
# Blonde Amateur Sex
Gravatar Kunio Kitamura, executive director of the Japan Family Planning Association, conducted the survey. The quotes attributed to Kitamura are hopefully the result of a poor translation from Japanese: "The fact that people can't eat breakfast may show something about their family environment. Before blaming individuals for having sex at an early age, it may be necessary to look into the sort of homes they are from." In other words, it's not your kids' fault they're having sex. It's because the muffins were stale...
Left by Blonde Amateur Sex on 4/6/2009 12:57 PM
# Celebrity Sexy
Gravatar If you liked this nasty mature check more of her!
Left by Celebrity Sexy on 4/6/2009 1:46 PM
# premiumporn.info
Gravatar Recent Entries Brunette camslut Sweet young teen Sarah public nude Amateur Blonde Whore Sucks Off Her Boyfriend Naughty Canadian Teen Mina Hot Girls on Vacation Pretty babe with stockings taking selfpics Horny Slut likes Fucking Sexy naughty slut strips down in front of her cam Very sexy teen camgirl Cami:
Left by premiumporn.info on 4/9/2009 4:36 PM
# matureposers.info
Gravatar Hi Cucks and Queens! Welcome back to Niggah ville! Heeheehee… I’ m so gay. Well, it appears you Cucks liked the last update so much, this Size Queen decided to do it all again. This time I found another Kooky Cuck Boy with a 3 inch pee- pee to lick me clean. Not before some humiliation! First, I measured his pathetic dick. It was a whopping 3 inches. So I laughed. Then, I brought in 2 Black Bull s and sucked their delicious dicks. Then, I undressed for them, and took some of my cute clothes and put them on...
Left by matureposers.info on 4/10/2009 2:16 AM
# Anal sex
Gravatar Blonde hentai slut with massive round juicy tits gets fucked doggy style! Big Bouncing Anime Tits Free Porn Movies!
Left by Anal sex on 4/11/2009 2:16 PM
# Hard core group sex
Gravatar The TAX CUTS have turned into free money give- aways… especially for the rich. A poll taken a year ago show that majority of Americans prefer that the TAX CUTS be eliminated and that monies go toward job creation programs and the deficit.
Left by Hard core group sex on 4/12/2009 2:48 PM
# Ebony Porn
Gravatar Thanks for the font links-- I'm always looking for food dingbats to add to my correspondences! There are some good items in there, like the French press in particular. /
Left by Ebony Porn on 4/12/2009 6:24 PM
# Fat Girls Porn
Gravatar Hot Blonde Amateur Milf Sucks Cock. Click the picture to jerk on!
Left by Fat Girls Porn on 4/12/2009 6:36 PM
# maturesexonline.info
Gravatar Recent Posts Hard fucked trailer- Trina Micheals Good tits girl- Crista Moore Beautiful big tits- Kristal and Isabella Beautiful huge boobs babe- Taylor St. Clair Big breast female- Eliza Big Tits, Anal Sex, Cumshot Swallowing Single, Ass to Mouth, Gapes Porn sex vids- Summer Sin Sexy busty- Sexy Vanessa Beautiful huge breast- Mia Horny massive tits girl- Katie Morgan Slut big tits-
Left by maturesexonline.info on 4/12/2009 9:12 PM
# Mom Mature Gallery
Gravatar To Carolina, Ferdinand, and me it was authorized to be only spectators, as as we were spoken by the senior brothers and sisters, we were too small to accept in all this participation. And as I thirsted this! When there was an opportunity, I on a stage and danced until they did not banish me. I liked to dance above all. Therefore the message of mum that actors here will come, has caused in me delight. - They will come here not to play with you, Antoinette,- has told she strictly,- They will be here to train...
Left by Mom Mature Gallery on 4/22/2009 6:12 PM
# Mom Mature Son Gallery
Gravatar I stopped by the movie theater to pick up my ticket. Yes I am a loser! Anyways that’ s when I saw a hot blonde MILF in a tight green top buying a ticket for some gay ass film. I bagged on the ho a bit and as always women like douche bags. To no ones surprise she agreed to come back and fuck my lucky ass on film. Once ho got back I spread her meaty MILF pussy wide to lick her juicy cunt. Cum see her pussy up close when you click here!
Left by Mom Mature Son Gallery on 6/7/2009 8:59 PM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Please add 6 and 3 and type the answer here:

Preview Your Comment.