Scott Hanselman

Hidden Gems - Not the same old 3.5 SP1 post

August 14, 2008 Comment on this post [32] Posted in ASP.NET | ASP.NET Dynamic Data | ASP.NET MVC | Windows Client | WPF
Sponsored By

Folks were hassling me in the comments for not posting the picosecond that .NET 3.5 SP1 came out (or, as I like to call it, .NET 3.6 - although the bosses really don't like that).

First, the obvious stuff.

Should I fear this release?

I wouldn't. The SP1 Framework is full of goodness. The VS Installer is slow (it was for me) but I just shut everything down, ran it, and was patient. It's POSSIBLE. It's way better than the beta installer was. There's a metric buttload of little VS fixes and tweaks that make the IDE a more pleasant place to spend your day. ScottGu lists a bunch of new stuff, like JavaScript intellisense, formatting, editor performance improvements, and on and on.

If you want to see some crazy interesting statistics, go check out Patrick Smacchia's updated 3.5 SP1 Changes Overview.

You can get it here:

If you've ever installed anything wacky or beta, be sure to run the important Preparation Tool and also R'ingT*M.

Now, why should I bother?

What's it got for ASP.NET?

There are lots of details here http://www.asp.net/downloads/3.5-sp1 including stuff on things we used to call ASP.NET 3.5 Extensions (in case you were wondering where all that went.)

ASP.NET Dynamic Data: This is now included in the .NET Framework 3.5 Service Pack 1 release. You can find further information on ASP.NET Dynamic Data here as well as instructions on how to convert applications written using the ASP.NET 3.5 Extensions December 2007 CTP in the readme. Piles of Dynamic Data videos here.

ASP.NET MVC: Nope! MVC has always been a separate release. Check out Phil Haack's blog for details!

ASP.NET AJAX browser history: This is now included in the .NET Framework 3.5 Service Pack 1 release. You can find details of how to convert applications written using the ASP.NET 3.5 Extensions December 2007 CTP in the readme. Check out the Video on AJAX Browser History.

ADO Data Services - It's RESTful! RESTy! A POX on your data! It's AtomPubtastic. Go check out Pablo's most excellent ADO.NET Data Services ("Project Astoria") videos from Mix.

ADO.NET Entity Framework: The ADO.NET Entity Framework is now included in the .NET Framework 3.5 Service Pack 1 release. You can find the documentation for the ADO.NET Entity Framework here. There's also an EntityDataSource.

ASP.NET controls for Silverlight: These ASP.NET Web server controls make it easier to use Silverlight in ASP.NET Web applications. These controls are now included in the Microsoft Silverlight 2 Software Development Kit.

Not to mention other new features like AJAX Script Combining (check the AJAX Script Combining video by Bertrand) and find out "What's the big deal with Script Combining?"

What's it got for Fat Chubby Smart Rubenesque Clients?

Bunch of new SP1 stuff on the client side, and I fully intend to have BabySmash exploit the new stuff as much as possible.

One of the cooler things is the new 3.5 Client Profile bootstrapper. This means I can get a Windows XP SP2 machine with no .NET Framework installed up and running with the 3.5 Client (WinForms, WPF, etc) assemblies in just 26megs with a 200k bootstrapper. I'm going to blog on how to do this, and use BabySmash as a guinea pig soon.

  • Immediate Responsiveness: Bootstrapper is small (200K) to enable the fastest possible response. After the security prompts, the user immediately is presented with the EULA.
  • 3 Clicks: One for the application, installing certificates, and the EULA. For ClickOnce, the user clicks accept on the EULA and the application automatically launches once setup is complete.
  • Size and Speed: With a typical broadband connection, setup will take ~6 minutes or less.
  • Faster launch time: Bunch of NGen and memory layout and CLR improvements.
  • FireFox ClickOnce and XBAP support. Finally!

What about ASP.NET MVC?

There is likely some confusion around MVC as a few people expected ASP.NET MVC to ship in SP1. This is probably because MVC was included in 3.5 "Extensions Preview." However, the plan was always to ship in Q4CY08.

(That date is marketing speak, I've just learned. I tell people what Eilon told me - it'll ship in a month ending in "-ber." Possible "March-ber" but also maybe "next June-ber.")

Anyway, Phil has always said that MVC is on its own schedule and will ship when its done. Possibly when Duke Nukem Forever ships.

What else is new? What about ASP.NET itself?

Here's the unsung heroes. Scott Galloway and the ASP.NET will do some articles in exquisite (I hope) detail on http://www.asp.net soon on all the subtle good fixes in ASP.NET, so watch for those.

Here's some details on a few niceties for people who like their URLs and Forms a certain way.

  • RenderAllHiddenFieldsAtTopOfForm - In versions of ASP.NET earlier than the .NET Framework 3.5 SP1, ASP.NET renders some hidden fields (for example, __VIEWSTATE) at the top of the form. Other hidden fields (for example, __EVENTVALIDATION) are rendered near the bottom of the form, just before the closing </div> tag. By default, in ASP.NET 3.5 SP1, all system-generated hidden fields are rendered at the top of the page. This makes sure that the information in these fields is sent to the server even if a postback is performed before the page has finished loading. If RenderAllHiddenFieldsAtTopOfForm is set to false, performing a postback before the page has finished loading can cause an "Invalid postback or callback argument" error.

    This is a nice, but subtle fix. Basically if you tried to do a postback (AJAX or otherwise) before the whole page was loaded and one of the hidden fields like __EVENTTARGET wasn't loaded yet because it was rendering at the bottom of the page, you'd be in a pickle. And you'd get a validation error on post. Now you can set this to true and move those hidden fields to just below the <form>.
  • HtmlForm.Action is now settable - Again, subtle, but very cool.  I like to use URL rewriting a lot and want my <form action=""> to be a certain way. Now I can set it manually without fooling around with RegEx's and messing with the whole response.
  • RedirectMode for CustomErrors - Also nice for URL redirects. If you set the redirectMode on <customErrors/> in web.config to "responseRewrite" you can avoid a redirect to a custom error page and leave the URL in the browser untouched.

A few more advanced improvements:

  • There's a new overload of System.Web.Caching.Cache.Insert() and a new CacheItemUpdateCallback. Thomas Marquardt has more on this in detail. Now you can get notified when a cache item is invalid and you get an opportunity to generate a replacement. This means you actually get warned BEFORE the item is yanked.
  • New RemapHandler method on HttpContext lets you swap in your own IHttpHandler mid-request as long as you do it before MapRequestHandler has been called.
  • New throttling option under IIS7 using aspnet.config. You can set MaxConcurrentRequestsPerCpu or MaxConcurrentThreadsPerCpu. For example, if you had a number of high-latency calls that were tying things up, you could use change the Concurrent Threads setting to throttle more logically than Concurrent Requests.
  • Now Response.Flush is safe reliable to call from a background thread. Before you could wreck havoc if you called Flush from the the background in an AJAX app, but no longer!
  • Remember that System.Web.Routing has been brought over from MVC world and is a core part of ASP.NET now. You can use ASP.NET Routing as you like and there's a fine writeup on Routing here. How is Routing different from URL Rewriting?

    ASP.NET routing differs from other URL rewriting schemes. URL rewriting processes incoming requests by actually changing the URL before it sends the request to the Web page. For example, an application that uses URL rewriting might change a URL from /Products/Widgets/ to /Products.aspx?id=4. Also, URL rewriting typically does not have an API for creating URLs that are based on your patterns. In URL rewriting, if you change a URL pattern, you must manually update all hyperlinks that contain the original URL.

    With ASP.NET routing, the URL is not changed when an incoming request is handled, because routing can extract values from the URL. When you have to create a URL, you pass parameter values into a method that generates the URL for you. To change the URL pattern, you change it in one location, and all the links that you create in the application that are based on that pattern will automatically use the new pattern.

If any of these small but important fixes make you smile, thank Stefan Schackow and the ASP.NET team. If you ever see them, give them a hug, it'll make them very uncomfortable. There are more fixes, and I hope ScottGal expounds on them soon at http://www.asp.net

What about Connected Services?

On the services side, Sam Gentile points out a bunch of new WCF features in 3.5 SP1 like:

  • Improvements in writing REST based services ranging from easily supporting ServiceDocuments publication and consumption to providing greater control and usability of UriTemplate with new syntax. AtomPub support in a new Object Model.
  • DataContract Serializer gets way easier by relaxing/removing the ned for [DataContract] and [DataMember] on types. It's POCO (Plain Ol' CLR Object) time, people.
  • More interoperable object references in the serialization format, which means WCF gets along better with Java.
  • New Hosting Wizard when making new WCF Services.
  • Better Partial Trust behavior, particularly when tracing/logging.
  • Support for ADO.NET Entity Framework types in WCF contracts.
  • WCF Templates for consuming services from Silverlight.
  • Scalability increases of 5X-10X (oy!) for WCF services hosted in IIS7-integrated pipeline mode.
  • The Workflow Designer is has a number of performance improvements and is generally quicker.

Related Posts

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
August 14, 2008 4:45
I'm loving the new SP1 bits so far. Great rollup of all the info one needs to know. Thanks!
-Ryan
August 14, 2008 4:57
You work for The Man now, man! You gotta promote this stuff!
Wait I guess you did. But I assumed you would do it sooner since you are internal and would want to promote it (some random guy on dotnetkicks gets the creds from me)

Anyways it's awesome. I experimented with astoria and used it with some jquery in an intranet website already. Weee!
August 14, 2008 5:09
Heh. I did this post for you Mofoo. I figured everyone else was promoting it, why jump on board? I don't want to blog stuff if I'm not adding value. I needed to think about this post for a while before I did it, otherwise I'm just copy/pasting Press Releases, and that == FAIL.
August 14, 2008 5:13
If only it had been called 3.6! Or even 3.5.1. But we have had that conversation before...

Unfortunately, within an hour of installing 3.5 SP1 RTM, I discovered that it broke the most important application that I work on (http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361539), which means SP1 will be banned in our company unless and until we can get a hotfix. Really too bad, I have been looking forward to it for a long time.
August 14, 2008 8:00
Thanks for the tip. I checked Windows Update and didn't see it, so I thought we were safe. I'll make sure our domain admins are keeping an eye out.

Anything you could find out would be greatly appreciated. Maybe I should also mention that uninstalling SP1 did not immediately fix the problem. I had to uninstall everything all the way back to 2.0 and then reinstall back to 3.5 before our application would work again. I guess the 3.5 SP1 uninstaller doesn't revert the CLR back to its previous condition?
August 14, 2008 8:22
"March-ber" but also maybe "next June-ber." - fingers crossed for January'ber ;)
August 14, 2008 10:54
I'll be particularly interested to read the how-to on the Client Profile bootstrapper. Everyone's raving about it but I have yet to dig up a concise guide on the steps involved. (My Google-Fu skills erosion notwithstanding).
August 14, 2008 11:01
Dimitris - There's nothing on Google yet, but I'll get something up as SOON as is humanly possible.

David - I'm chasing your bug now. I'll report back soon.
August 14, 2008 11:01
Dimitris - There's nothing on Google yet, but I'll get something up as SOON as is humanly possible.

David - I'm chasing your bug now. I'll report back soon.
August 14, 2008 11:21
Since when was 200k "small"?

The entire binary for µTorrent 1.8 is 260 kB! 200kb takes almost a minute on dial up.

Anyway. Some nice new things here - the naming scheme is really screwed up though.

Any idea when this'll be appearing on WU?

I'd also like some guidence on how to check if I'm depending on 2.0sp2 (or 3.0sp1, etc) features and/or running on them.
August 14, 2008 12:00
Your link for VS Team System download goes to the one for VS TFS. You can't install VS TFS on VS TS. The installer will say your computer doesn't have the required files.
August 14, 2008 14:06
Should I fear this release?

Yes, if you're running WPF under IIS or some other service, eg:


- if you generate images on the fly for a web-app;
- if you use automated test tools running as a service.

Thread here:

http://forums.asp.net/t/1299963.aspx

(Apart from that, and for us it is a big THAT, this is an exciting release).
August 14, 2008 17:28
There is a lot of things I liked about the SP1 release. What I was most disappointed in however, was the web browser control. It appears to just be a wrapping of the winhostform with a winforms browser control in it. I say this, because it exibits the sames faults as the afore mentioned method of getting a web browser in your app.

Here are a couple of examples where the new control, and the old method exhibit the same bug. 1. When you put the webbrowser control in a scroll panel, it will display controls outside that panel as it scrolls past. 2. You cannot set the webbrowser in a panel that has allowtransparency set to true, and expect to see the control. It just doesn't show up.

Now those are my to beefs with the control. What I do like about the control is the NavigateToString function. Although I suspect it is writing the string to a file in a temp directory, I appreciate not having to role my own function for this. I also appreciate that it is "prepackaged" as that is less code that I have to maintian. I just think they fell a little short with this item.

Anyway, keep up the good work Scott. I appreciate the time and effort you put into your blogs, and podcasts.
August 14, 2008 17:45
I installed the SP1 on our machine and ran into some problems with one of our applications. We're using the RemoteSoft obfuscator product and it doesn't like SP1 for some reason. It might be related to what David Nelson brought up, too.
August 14, 2008 18:00
Did someone else his ListView disappear in the Toolbox after the installation of SP1?

How to solve this?
August 14, 2008 18:02
August 14, 2008 20:05
Fowl - Heh, sorry dude/dude-ette, 200k IS small. ;)

Abdu - Thanks, I'll fix that.

DavidMo - Yes, there is definitely a problem if a 2.0-style Obfuscator is used. I'm looiking into it.

Filip - Weird...looking...

August 14, 2008 20:24
Have you read any technical books on your Kindle? If I were to get one, I would primarily read technical books. Do you have a recommendation? I would want to read books like the one you are witting on ASP.NET MVC, Integration Pattners etc... Do you think it is worth my money or to just get the hard copies of the technical books?
August 14, 2008 20:37
Scott good post. Those three things you mentioned about the forms really made my day.
August 15, 2008 0:16
I have looked at a few different examples on how to use the new routing features but I can't seem to find one that really explains it fully.

I added the following route:

RouteTable.Routes.Add( new Route("test/{foo}", new CustomRouteHandler("~/test.aspx")));

CustomRouteHandler implements IRouteHandler

I have created test.aspx...but I have no idea how to get the value for {foo}?
August 15, 2008 13:24
Looks interesting, but I'd be curious to find out when lots of the dev shops that I work with will be replacing their already more-advanced tools such as ReSharper, CodeSmithTools, Ninject, CSLA, NHibernate, etc with Microsoft equivalents.
August 15, 2008 13:43

HtmlForm.Action is now settable - Again, subtle, but very cool. I like to use URL rewriting a lot and want my <form action=""> to be a certain way. Now I can set it manually without fooling around with RegEx's and messing with the whole response.

Great... This broke our code... Can no longer run code compiled on a SP1 machine on a RTM machine :(
August 15, 2008 13:46
Created bug 361981
August 15, 2008 13:54
Nice Scott,
Want to know more about WPF changes
August 15, 2008 19:26
You noted above that one of the items included in SP1 was MVC Preview 3. According to Phil Haack that is not true.


ASP.NET MVC was not released as part of SP1. I repeat, ASP.NET 3.5 SP1 does not include ASP.NET MVC. What was released with SP1 was the ASP.NET Routing feature, which is in use by both ASP.NET MVC and Dynamic Data.
August 15, 2008 21:50
@ davh

Wouldn't the logical thing be to install 3.5 SP1 on the box that only has 3.5 RTM?

I think the problem is that when you compiled it on your dev machine that has 3.5 SP1, the generated MSIL has an instruction to call __ctrl.Action = "whatever.aspx" (where __ctrl is your HtmlControl and the Action property translates to the set_Action(string) method). A settable Action property (set_Action method) *did not exist* before SP1, so more than likely your generated MSIL had an instruction to call IAttributeAccessor.SetAttribute("action", "whatever.aspx") instead. The IAttributeAccessor interface is how Web Form controls handle rendering attributes that are not explicitly defined for a control.

I'll admit this is a little confusing, primarily because of the helpful IAttributeAccessor interface that allowed you to specify server-side markup attributes that were not explicitly defined for a control, but it's a little bit like this:

You compile some code that calls a method SomeObject.NewToSp1() on a DEV machine that has SP1 installed and then you try to run that compiled code on a machine that doesn't have SP1 installed. What would you expect it to do? It's doing exactly what it's supposed to, complaining that the method doesn't exist. (Again it's a bit confusing, because it "worked before"... but that is a special case here because of how Web Form controls used to handle server-side attributes that weren't explicit defined for a control).

The logical step is to install SP1 on whatever machine you're running your SP1 compiled code.
August 15, 2008 22:16
@ davh

Here is another take on it from ScottGal (ASP.NET Team). Not sure if he confirms my assertion or not, although it might be a better forum to pose your question...

Issue: The HtmlForm action attribute is now honored when defined in declarative markup.

August 18, 2008 17:44
Everything I read about the client profile suggests it will be a dissapointment. Either way, the download link has been retracted ( aka broken ) and when it was there it said it was 255MB.
August 18, 2008 18:56
The MVC framework is full of bugs and there's no documentation for it. Obviously it's not ready for release.

I don't see why people want it anyway. It undoes everything you know about ASP.NET. It shouldn't even be called ASP.NET but something else. I think it's another case of Microsoft inferiority complex. Some other software tool has it, and Microsoft programmers suddenly worry that they are not doing "real" development because the latest over-hyped gizmo is missing.
August 20, 2008 7:22
And the new feature of running managed code from a network share in the MyComputer zone.

http://ferventcoder.com/archive/2008/08/19/.net-framework-3.5-sp1-no-more-need-for-caspol-on.aspx
August 23, 2008 9:22
To install Vs2008 and dot net framework sp1 combined we need about 4 gb plus of space in the drive where it is installed. I do not have that and cant I get that much space available. Any workaround for that available?
September 06, 2008 7:39
Is there any documentation or kb articles on what happens when you compile an app on an 3.5 sp1 machine and deploy it to a server that doesn't have sp1 installed? Is there a way to "target" 3.5 vs 3.5 sp1?

--jb
jb

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.