Todd Anglin's Code Campground

A casual look at the world .NET coding
Another Solution for Defeating the SQL Server 2008 Installer with Visual Studio 2008

Here’s the problem:

I have a clean Win7 RC box with VS 2008 SP1 installed and a working SQL 2008 Express “Data Base Engine” (installed via the Web Platform Installer). I discovered that SQL Management Studio Express was missing, and there began my long and frustrating journey to install Microsoft’s SQL management tools…

I’m not sure why the tools were missing in the first place, but it turns-out that there is no simple way to install them. There is no separate installer for the tools as there was (so conveniently) for SQL Server 2005. [UPDATE: After fighting a long battle, I rediscovered an option in the new Web Platform Installer to add the SQL Management Tools to SQL Server 2008. A little late now to know if that would have worked, but hopefully you can give that a try before getting too far on your own painful SQL Server 2008 journey.]

Enter the SQL Server 2008 installer. After countless attempts to “add” the tools to my existing install, I could never get the installer to provide me with the desired options. Not one to waste time “fighting software,” I uninstalled SQL Server 2008 and started fresh. To my dismay, the SQL Server 2008 Installer started throwing this install-blocking error at me when trying to re-install:

Setup will not complete because the rule "Previous releases of Microsoft Visual Studio 2008" failed.

This message further asserts that you must install Visual Studio 2008 SP1 before the installer will continue. But…like many others, I already installed SP1!

So, I began looking for hacks around the installer. There are many options scattered across the web, but the tip that finally made things clear is this:

The SQL Server 2008 installer is checking the HKLM\SOFTWARE\Microsoft\DevDiv\XXX\Servicing\9.0\SP reg keys to tell if SP1 is installed. If you inspect those keys and find any SP keys with the value “0,” that is your road block.

As it turns out, every installed version of Visual Studio 2008 must have SP1 installed for the SQL Server 2008 installer to work. This leads to the other main source of confusion:

If you installed SP1 for your “main” VS 2008 version (such as Pro or VSTS)- and you’re sure of it- there is probably some other version of VS installed that does not have SP1 installed (such as Express or- as in my case- Shell).

Inspecting your reg keys is the fastest way to discover if such a version is installed. In my case, I discovered that there was an entry for both “VSTS” and “IDE” in my Visual Studio reg keys. VSTS was my main Visual Studio version, and its SP reg key correctly indicated that SP1 was installed. For the IDE entry, though, the version was listed as RTM with no SP.

What is the “IDE” version of Visual Studio?

Thanks to the info on Heath Stewart’s blog, we learn that this reg key entry is for Visual Studio Shell edition. It’s not clear when this version of VS2008 is being installed (or how important it is for other programs), but uninstalling it or upgrading it to SP1 is yet another way to solve your SQL Server 2008 install problems.

One more handy tip.

If you really want to take a blunt-force approach to any of the SQL Server 2008 “warnings,” there are command line switches that enable you to bypass some of the rule checks. Originally revealed by “Paul” in the comments of another blog post, you can use the following switch to launch your SQL Server 2008 installer with the VS version check and “reboot required” rules disabled:

setup /ACTION=install /SkipRules=VSShellInstalledRule RebootRequiredCheck

Based the sheer volume of comments and blog posts already on the Interwebs about this very topic, it would seem that Microsoft may have regressed a bit with the release of SQL Server 2008. I’m sure there are plenty of “good reasons” for why SQL Server 2008 “has” to be so dependent on VS 2008, but the end result is clearly lots of frustration for users. I hope MSFT takes note and makes things simpler for the next version. I know many hours of frustration will be saved if they do!

Windows 7 Beta – Application Compatibility List (update)

Starting Windows 7 With Windows 7 officially in beta and millions of people apparently clamoring to try it, I expect many people will be playing the “does it/doesn’t it” work game with their favorite software and the new beta OS. I recently made the jump to start running Win7 full-time and have already installed a number of applications with varying degrees of success. To help others traveling along this path, I plan to log my experiences here for my app compatibility experiences with Win7 Beta.

Before I begin listing apps, though, let me provide my general advice when it comes to installing software on Windows 7 beta. It is very possible that you will hit problems when trying to install your software, but in almost all cases, you can solve your problems with these steps:

  1. Re-run the installer as “admin”
    With elevated privileges, most installs recover and work- even installs that should have worked b/c they worked in Vista.
  2. Re-boot, re-run the installer
    When the simple “Run as admin” fails to solve the problem, try rebooting, then re-running the install. In cases where run as admin failed, rebooting solved most of my remaining install problems.

With that out of the way, here are the specific apps I’ve installed and the current status (last updated: 20 Feb 2009):

App Name Status/Notes
Office 2007 Ultimate (including Outlook) No problems. Ran installer as admin.
Cisco VPN (5.0.00.0340) HUGE problems. After install, BSODs Windows. There is a solid work around out there, though. This worked for me:
http://blog.tiensivu.com/aaron/archives/1817-How-to-prevent-Cisco-VPN-client-version-5.0.4.0300-installation-from-bluescreening-Windows-7-x32-Build-7000.html
Trillian Astra IM (Beta) No problems. Works well.
Firefox 3.1 (Beta) Installs fine, but must run as admin. Won’t launch if not launched as admin.
Extensions:
FireBug 1.4 (alpha) works fine in FF3.1 beta on Win 7. Foxmarks works, too.
Chrome (v1) Installs and runs fine
UPDATE: Well, maybe it’s not perfect in Win7. Chrome is crashing much more often than it did in Vista (yes, Chrome does crash). Works most of the time, but a little buggy.
Live Mesh Installed and worked at first, now fails to start on boot. Fails to start and provides relatively generic error. For now, this is broken for me, though I know it’s working for others. Also, cannot uninstall- all attempts currently fail.
UPDATE: After disabling UAC, it now works!
SnagIt (v9) Installs and works fine.
Visual Studio 2008 Team System Installs and works fine (so far)
UPDATE: Only major problem so far is working with web services. All attempts to use WCF or ASMX web services in Cassini currently fail. Others have mentioned this problem. Hopefully MS will fix this soon.
SQL Express 2008 Installs and works fine. Ran installer as admin.
Expression Blend Installed fine. Haven’t tested yet.
Silverlight SDK, VS Silverlight Tools Installs fine and runs fine
RegEx Buddy Installs fine, runs fine.
Xobni (Outlook plug-in) Installs and works well. Performance much improved recently.
Live Writer Using it now. Installs and works fine.
Adobe CS3 (Illustrator, Photoshop, InDesign) Install is a little tricky. Failed the first time. After a reboot and run as admin from a DVD (must burn files to disc first), installs fine.
Ashampoo (DVD burning) Window’s built-in data DVD authoring would not work for me. I installed Ashampoo and it worked fine.
UPDATE: After disabling UAC, Windows data DVD authoring is working as expected.
Telerik RadControls/Telerik Reporting/Telerik OpenAccesss ORM/Telerik WebUI Test Studio All Telerik tools install and work fine. Development experience works and apps built with the tools work in Win7.
Virtual Clone Drive (ISO mounter) Install worked fine, but application does not work. Worse, cannot be uninstalled. Install at your own risk for now.
ReSharper 4.1 Installs fine. Seems to work without serious problems.
ZoomIt (utility) Works without error in Win7 beta.
GoToMeeting (UPDATE) Works fine (I’ve used GTM and GTW) BUT for whatever crazy reason, Citrix blocks downloads of the GTM software when you access the download site from Win7. Just plain dumb since their software already appears to work fine in Win7. Workaround: grab the installer directly and you’ll be fine:
http://www.cto20.com/Home/tabid/647/EntryId/91/How-To-Run-GoToMeeting-on-Windows-7-Duh.aspx
Internet Download Manager (UPDATE) Installs fine, works fine, intercepts download fine
Camtasia Studio 6.0 (UPDATE) Installs fine, works fine. I’ve recorded a few video, edited them, and published them without issue.
3D-FTP (UPDATE) Bah! I’ve love this program for so long, but alas the latest version just doesn’t work well on Win7. Granted, I’ve never used the latest version on Vista (I was using an older version previously). Point: latest version is not worth the upgrade.
CuteFTP 8 Pro (UPDATE) Installs and works great! Better than 3D-FTP.
Virtual PC 2007 (UPDATE) Installs fine, works fine. I’ve built a Vista VPC and it works like normal.

UPDATE: I just got tired of needing to elevate everything to “Run as Admin” to get anything done, so I disabled UAC completely. After a restart, low and behold, Live Mesh started working! And, the files that previously wouldn’t work with Windows DVD burner suddenly were available for burning! Guess UAC needs some more “tweaking.” For now, if you’re a power user, you can probably save some headaches by turning it off. </update>

That’s all for now. As you can see, the only things really giving me trouble are Live Mesh, Virtual Clone Drive, and Window’s own built-in DVD authoring. Otherwise, things are working well. If I have any other major installs, I’ll be sure to update this post, so bookmark this for future reference. Also, feel free to share your own experiences in the comments to help others. If there are enough comments, I’ll update the post with the community compatibility updates.

Hope this helps all of you joining me on the bleeding edge!

Chrome still needs some polish

chromeBugs As pretty much the entire developer world knows by now, Google recently made a splash by introducing their own "home grown" browser called Google Chrome. The browser was introduced as "the browser that does everything right because it doesn't have legacy baggage," and it has largely lived up to its billing. The browser is fast. It's easy on the memory footprint. And it's definitely got Google's minimalist signature all over it.

That said, as I sit here typing this, I'm waiting for Google Chrome to respond. It seems one of my tabs has introduced some nasty JavaScript and completely hosed the entire, well, chrome. That's right. The sin which Chrome was supposed slay (one tab crashing the whole browser) still lives. And that's not the only sin that lives.

In the weeks since Chrome's introduction, I've been using it as my new primary browser (move over Firefox 3 and your continued memory bloat). Over that period, I have come to appreciate the good and the bad with Google's freshman browser effort, and I can definitely report that it has its issues. Not enough to make me stop using Chrome as my primary browsing browser, but enough take some of the shine off Google's glistening browser.

Among the observed problems, here are my top "complaints" (or "ways it could be improved" for you optimists out there):

  1. DNS Resolver is Weak: Don't know why or what this means, but on multiple occasions, sites that wouldn't open in Chrome could be successfully loaded in Firefox. It seems like Chrome has trouble establishing a connection with some sites and just quits trying (providing "UNKNOWN ERROR" as the most helpful of error explanations). This is a pretty big deal since it could mean users hitting this error think your site is inaccessible when, in reality, it may just be inaccessible to Chrome. The problem is magnified by the fact that the "error page" looks just like a normal Chrome 404 page, so it isn't entirely clear Chrome has encountered a problem. Hopefully this is on the top of Chrome's "must be improved" list.
  2. Rendering Not Perfect (or at least not same): This isn't a big deal to users per se, but as a web developer (and a web component vendor) it is rather annoying to have yet another slightly different rendering engine to support. True, Chrome is most like Safari, but it's not identical. That means another set of CSS hacks, JavaScript tricks, and browser testing scripts to manage. And yes, hacks and tricks have already been identified that are required to support Chrome. Thanks Google...
  3. Weak Developer Tools: Again, more of a developer complaint, but Chrome still lacks the powerhouse developer tools Firefox provides (albeit via its add-on market). Chrome does pack some interesting developer oriented tools, but they're not nearly powerful enough to replace Firebug or the Web Developer toolbar.
  4. Inconsistent Plug-in Experience: While this burden really falls on the plug-in vendors, it is annoying that plug-ins like Silverlight and Java don't consistently work in Chrome. Eventually I'm sure these plug-ins will catch-up, but for now, it's hit or miss if the plug-ins you need to browse the web work in Chrome.

What does this all mean? It means Chrome is a "really good" browsing browser, but it's not good enough to be your only browser (yet). You still need Firefox or IE around to load specific sites or perform serious analysis on web pages. A pretty substantial accomplishment for a "brand new" (its roots are quite established, really) browser, so Google should be proud. If I were Mozilla, I'd probably start to reconsider those lunches at Mountain View - Google is definitely poised to kill Firefox popularity in a few years time.

I still plan to use Chrome as my primary browsing browser going forward. It loads faster than any browser out there (from a cold start), and that alone keeps me coming back. I'm also a fan of the new "intelligent" start page and the super-effective "everything bar." In fact, I've grown so used to using the address bar for both search and navigation in Chrome that I cringe when I'm forced to use a separate UI for those tasks in IE, Firefox, and Safari. With a little more time and a little more polish, I'm sure Chrome will really shine and quickly become my primary browser for browsing and developing.

What do you think of Chrome? Have you become a Chrome convert or do think Google's missing the mark?

Posted: Oct 06 2008, 09:45 PM by tanglin05 | with 3 comment(s)
Filed under: ,
XAML : Developers :: Modern CG : Spielberg & Lucas
jarjarbinks.jpg

For anyone having trouble understanding this post's title, it's old analogy syntax: XAML is to Developers as Modern CG is to Steven Spielberg and George Lucas. Still not making sense? Let me provide some more explanation.

How great directors lost their way with CG

Few people would disagree that the great movie directors of yore- namely Steven Spielberg and George Lucas- have passed their great movie making prime. If we look at the movies these directors have produced in the last 5 years (or so), like AI, War of the Worlds, or the new Star Wars, they pale in greatness to early hits. Movies like Jaws, Close Encounters of the Third Kind, ET, Indiana Jones, Star Wars, and American Graffiti are universal classics that make recent flicks look like uninspired, freshman projects.

So what happened? Did these creative minds become less creative with success? Did they lose their ability to make a great movie? I would argue that modern CG happened. Technology opened these director's brains for the world to, enabling them to put every "creative" idea they could conceive on screen. And that, as it turns out, is not a good thing.

Think about it. The practically fully animated Star Wars prequels with their armies of robots and everybody's favorite Jar Jar Binks. The latest Indiana Jones movies and it's cliche aliens and UFOs- and Indiana Jones flying through the air in a CG refrigerator. Even War of the Worlds, for all of its production value, didn't come close to capturing the magic of Spielberg's more successful alien movies like ET and Close Encounters. In each case, these movies were loaded with CG, "enabling" the directors to tells stories and put things on screen they couldn't have done due to technical limits in the 70's, 80's, and even early 90's.

And in each case, these movies have failed to live up to the greatness of their directors. Without technical constraints, these great creative minds aren't making great movies. It seems that creative minds like Spielberg and Lucas produce better results when thy have technical limits. Their movies actually benefitted in the past from some built-in editing. Technical constraints forced them to be more creative, to keep things simple. The result: better stories and better movies.

What's this got to do with XAML and Developers?

Just as great film makers made better movies when they had to be creative within limiting technical boundaries, I see the emergence of new "freeing" technologies like Silverlight and WPF (both based on XAML) creating a new challenge for developers. Now that developers can easily integrate animation, media, 3D, and a whole array of "wiz-bang" features in their applications, I fear developers will make the same missteps as the movies. Previously impossible features can now be easily included in apps, and in many cases developers and designers will probably see this as a good thing. "Finally we can put our ideas in to our apps," they'll say.

But will this lead to better applications for users? I'd argue that in many cases it won't. As application developers, I think we've benefited from a little technical constraint to keep our application's in-check and to force us to be more creative, more resourceful. With flexible technologies like XAML, great developers will be those that can be good "editors" of their own applications.

Are you saying new technology is bad?

Of course, not! I'm all in favor of new technology and moving the quality of movies and software forward. It just needs to be done appropriately to enhance traditional experiences, not completely re-invent them. We don't need Indiana Jones flying through the air in a refrigerator, but putting him on a rocket powered sled (again CG) is great! It fits the story and the CG makes the experience more believable. So it goes with software. Do we need to replace our ASP.NET AJAX apps with Silverlight? No, but we can definitely enhance them with technologies like Silverlight to make the experience more enjoyable where appropriate.

I suppose this all boils down to the old-ish adage: Just because you can, doesn't mean you should. As you start developing with new platforms like WPF and Silverlight, don't fall prey to "unlimited freedom." Be good editors of your applications. Create constraints. Be creative. If you do, I think you'll avoid going the way Spielberg and Lucas and you'll continue to create great software hits on these new platforms!

Posted: Aug 29 2008, 03:34 PM by tanglin05 | with 4 comment(s)
Filed under: ,
Potluck Programming (or UWWFY)

RabbitHole Have you ever found yourself spending more time trying to learn patterns than actually designing or coding your application? It's easy to do. With the maturation of .NET, suddenly everywhere you look you see presentations, books, and blog posts talking about this pattern or that pattern, each asserting that the other is inferior for some obscure reason. And you, being the mature .NET developer that you are, follow these conversations, desperately trying to find the "magic" patterns that will make your next project perfectly maintainable, easily extendable, and consistently scalable from the get-go. I know, because I've been there.

Now, there's nothing wrong with patterns. In fact, they're very helpful in moderation. They allow developers that implement code to benefit from the long winded thinking done by developers that have time to think about the absolute best way to do things. The problem, though, is that there is no "absolute" right or wrong way to do things. There are better  and best ways to do things for specific scenarios (as learned from collective experience), but no one can tell you the "right" way to write your application. And left unchecked, it's easy to wander down the rabbit hole of pattern research and get lost in "Patternland."

So, I'm coining (or re-coining, as the case may be) the term "Potluck Programming." Or if potluck's aren't your thing, UWWFY™- "Use What Works For You."

The concept is simple, but essential. When setting-out to improve your development with patterns, find patterns that help solve problems you have (not problems you think you'll have- YAGTNI), find patterns that make sense for your project (not every project is a huge enterprise, super complex application with the need for IoC containers), learn the patterns, and then start writing some code!

And don't feel guilty if you don't follow the pattern 100%. I like to quote the wonderful piece of 21st century cinema Pirates of Caribbean to explain this. In the words of the digitally-enhanced (or is it degraded?) Captain Barbosa:

"The patterns are more what you'd call guidelines than actual rules. Arrr..." (loosely quoted)

Patterns are supposed to help you write code in a way that avoids the problems other developers have encountered, but they're not supposed to be a paint-by-numbers guide to coding your application. Use what works for you and don't let patterns bog you down. And if you find yourself getting bogged down, step back and write some code. If nothing else, that will help provide more context for the pattern so you can learn it more quickly.

Hopefully this simple advice will help you avoid the productivity drain that pattern research can become. Have you ever found yourself crawling down the pattern rabbit hole? Sound-off in the comments.

What "cloud computing" means to you (it's important)

cloud computing It is amazing to me how quickly the the noise surrounding cloud computing has grown. Overnight cloud computing has become a mainstream talking point with everyone postulating how enterprising start-ups and lumbering enterprises will use the emerging technology in software projects. InformationWeek is running cover stories on cloud computing, Microsoft is touting their new cloud services, and even Apple is getting-in on the game with MobileMe. It seems cloud computing has replaced software as a service as the most popular water cooler talk.

And if you ask me, cloud computing is much more interesting and much more able to be a "game changer" than SaaS ever was. SaaS always seemed like a fancy way to describe hosted applications. It really wasn't anything new- eBay has been providing SaaS auction services for years- just a change in focus and maturity. Even as a young entrepreneur, I built career fair management software that I sold to customers from my hosted environment- who knew I'd "stumbled" on the SaaS business model.

Cloud computing, on the other hand, is substantive. It is bringing real, game changing technology to the table that is going to enable a new generation of entrepreneurs to capitalize on never before possible access to cost-effective, low-risk scaling. In other words, cloud computing is going to give little ideas the ability to reach big audiences without millions of dollars in financing. That's an exciting development if you're like me and you're always looking for ways to bring your ideas to life without investing your wife's life's (Freudian slip) savings.

The impact of cloud computing on .NET developers should be big, too. I fully expect to see cloud service integration become standard practice in .NET applications and a new crop of tools to emerge that will help developers with the challenges cloud computing presents (network latency, dynamic scaling, etc.). At the component level, I wouldn't be surprised to see new data controls that enable you to easily bind to cloud data or ORM tools that make managing scalable data in the cloud as easy as managing a single instance of SQL Server. Unlike SaaS, cloud computing will have an impact on your daily developer life.

For those of you less interested in the business impact of cloud computing and still struggling to see its purpose, there are clear consumer driven applications of cloud computing sprouting-up at the world's major software producers that should provide some clarity. Take, for instance, the "could drive."  The long awaited drive that lives on the Internet, enabling users to save their files on their computer and access them anywhere, anytime.

Microsoft and Apple are prepping services that bring this dream to life. Microsoft's LiveMesh is a software + services approach that uses a small client install to enable seamless file synchronization between all of your devices (PC, Mac, and Mobile). Similarly, Apple's iDrive, previously part of .Mac and now a member of MobileMe, enables you to save files on your Mac and easily access them on the web or on another PC. Apple provides its software integration at the OS level, but end result is very similar to Microsoft's and both offerings rely on cloud services and storage to deliver the anywhere, anytime data access.

With Microsoft's offering in particular, developer's have a unique solution to one of the biggest problems facing Silverlight: no local file system access. How do you build web-based replacements for client-apps if you can't save files to the local file system? Live Mesh. Using the Live Mesh APIs, you simply save an user's file to the cloud and the cloud in-turn syncs the file to the desktop. It's roundabout, sure, but it's also compelling since this approach should mean the file is always available to your online app, even if the user travels to another computer.

But where's Google? Long before LiveMesh and MobileMe were twinkles in a marketer's eye, Google was rumored to be building "GDrive," a Google-powered cloud storage service that you could use to backup and access your files. Since the early rumors, though, Google has been mum on the GDrive topic, allowing both Apple and Microsoft to beat the perennial cloud proponent on what should be their own turf. It is bizarre that Google appears to be a late mover in the cloud computing space, but I think it's safe to bet Google will eventually make their move.

Until then, the work by companies like Microsoft, Amazon, EMC, and others make it clear cloud computing is here to stay, and in a big way. And while I don't think the term "cloud computing" will last forever, the use of the Internet as an applications platform will.

Silverlight Mobile Road Map Refresher

In keeping with my apparent "theme" this week of providing you with some Silverlight detail refreshers, I want to bring-up the topic of Silverlight for mobile platforms. While it has been widely known since the earliest days of Silverlight that mobile platforms would be supported, little attention (or scrutiny) has really been applied to the portable plug-in. In fact, if I were to ask you to tell me about Silverlight's mobile plans right now, you'd probably list these details:

  • The plug-in will not require you to change your Silverlight code (build once, deploy everywhere- ideally)
  • The mobile plug-in will be available for Microsoft Windows Mobile and Nokia S40/S60 and Internet Tablet platforms.
  • Microsoft is actively trying to develop partnerships to deploy the plug-in on other mobile devices. And no, the iPhone is not on the known short list.

But quick! Tell me which version of Silverlight is coming to the mobile platform first? And when is that version going to be available? If those answers don't come to you as quickly, I don't blame you. The information is not really circulating as prominently as it should be.

In my preparation for a recent trip to India- the place where all Silverlight Mobile development is done, by the way- I collected the latest known public details on Silverlight's mobile road map and will share them with you here. In short, Silverlight's road map looks something like this:

silverlightMobileRoadMap 

What's this diagram saying? Exactly this:

  • The first version of Silverlight for Mobile is going to be Silverlight 1.0 (JavaScript only - no .NET) and a CTP should be available any day now.
  • We'll get the first "official" Silverlight for Mobile (1.0) towards the end of this year, sometime after Silverlight 2.0 officially ships for the desktop. Around the same time we should get a CTP of Silverlight 2.0 for Mobile.
  • Finally, around this time next year we'll get the .NET-loving version of Silverlight for Mobile.

It appears that the Silverlight for Mobile development is lagging about a year behind it's desktop counterpart, which may come as a surprise to some. The real take-away here, though, is this: if you're planning on doing any Silverlight development for mobile platforms, don't expect to begin rolling-out production applications until early 2009. If you want to roll-out applications that re-use that fancy Silverlight 2.0 .NET you're writing now, expect to wait 'til next summer for production.

This post isn't intended to be "doom and gloom" on the Silverlight for Mobile road map, but rather a reality check for any developers that are getting increasingly excited about Silverlight 2.0 and are starting to make plans for real application development. Silverlight for Mobile is definitely coming- and it will be cool when it arrives- just don't expect to launch new Silverlight 2.0 apps completely cross platform (as in, including mobile devices) until sometime next year.

Isolated Storage changes in Silverlight 2

This isn't exactly what you call "breaking" news, but it is news that I don't see getting enough coverage. I also just noticed that I've been doling out bad info in my recent Silverlight 2 beta 1 presentations, so I wanted to take a minute to correct the record and set things straight.

The News

In short, Silverlight 2 beta 1 introduced some changes to the Isolated Storage API and its defaults. In Silverlight 1.1 alpha, the default Isolated Storage quota size was 1 MB. In Silverlight 2 beta 1, the default has been reduced to 100 KB. The issue is not that significant, and I expect many Silverlight apps will not have a problem staying well inside of this quota. But if you're planning on making any "significant" use of the Isolated Storage, be prepared to hit your quota limit fast in Silverlight 2.

The other tidbit that was news to me is how API for requesting a larger quota works. While the API for requesting a larger quota makes it appear like you can request any quota size you'd like (it accepts a size in bytes that you want to set the quota to, after all), in reality there are only a few discrete quota sizes you can use: 100KB, 1MB, 5MB, 10MB, and Unlimited.

That means requests for sizes larger than one if the discrete values will automatically round-up to the next valid quota size. And if your request is for a quota larger than 10MB, Silverlight will automatically ask the user to give you an "unlimited" quota. What's not clear at this point is what "unlimited" means, but it is likely that space will be limited by some user-configurable value (in the soon to arrive Isolated Storage configuration menu). I expect it will be very similar to the way users configure the allowed size for IE temporary files.

I also think that this setup, however well conceived, means the Isolated Storage API should be altered. Why use an API that accepts a freely defined integer value when only 5 distinct options are available? Perhaps an enumeration would make things more clear. In the absence of a clear API, though, just make a mental note and don't be surprised when your request for 2MB is automatically translated in to a request for 5.

Quick Review

For those of you that have yet to try increasing the Isolated Storage quota, the process is very simple. All you must do is tell Silverlight how large you'd like to make your application's storage quota (in bytes) and it will prompt the user asking for their permission to grant the increase. If they approve it, you're in business. If they don't, you must design your application to handle rejection. See the code snippet below for a quick look at how the API works.

// Obtain an isolated store for an application and ask user
// to allow quota increase
try
{
    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
    {
        // Request to increase the quota size
        Int64 newQuotaSize = 1 * 1024 * 1024; //1MB
        Int64 curAvail = store.AvailableFreeSpace;

        // If available space is less than
        // what is requested, try to increase.
        if (curAvail < newQuotaSize)
        {

            // Request more quota space
            if (!store.TryIncreaseQuotaTo(newQuotaSize))
                lblAlert.Text = "Increase rejected.";           
            else
                lblAlert.Text = "Increase approved.";
        }
        else
            lblAlert.Text = "1 MB is still available.";
    }
}
catch (IsolatedStorageException ex)
{
    lblAlert.Text = ex.Message;
}

Beyond that, there are only a few additional facts important to remember about Isolated Storage quotas:

  • While Silverlight Isolated Storage files are isolated at the application level (per XAP), the quota is set per domain. This design is for security, and MS's Wilco Bauer has a good explanation on his blog.
  • Isolated Storage is a non-volatile cache. That means it won't be cleared by browser cache resets. The files are stored separately and can only be cleared by the Isolated Storage API (in other words, programmatically by your app) OR by the user with the forth coming configuration menu.
  • Isolated Storage is shared across browsers. Changes made to files in Isolated Storage in Firefox are accessible in IE and vice versa. That also means they share the same quota, so you don't get separate space allocations for each browser.
  • You can only access the GetUserStoreForApplication() method within a Silverlight initiated event (such as a Silverlight button click). You cannot fire requests to increase the quota arbitrarily- you must respond to some user action.

Hopefully this post helps highlights some important changes in the Isolated Storage quota system in Silverlight 2 beta 1 and sets you up for successful development on the soon to arrive Silverlight 2 beta 2. Assuming it doesn't make any more significant changes...

Second Life Heroes Launch Event Tomorrow

herosHappenSL

[Content cross-posted from TelerikWatch.com]

I regret not giving this event more coverage, but late is better than never  (right?). Tomorrow, Saturday, April 26th, in the vast realms of Second Life, Microsoft and the Second Life .NET User Group are putting on a virtual Heroes Launch. You may have seen Heroes Happen Here Launch events in the "real world" over the last few months. They are being organized all over the globe to help get people introduced Visual Studio 2008, SQL Server 2008, and Windows Server 2008. And now they're even being organized "out of this world" and in the virtual realms of Second Life.

All of the action will kick-off tomorrow at 9:00 AM SLT (Second Life Time = PST) and run 'til about 5:00 PM. To join the fun, all you need to do is make sure you've downloaded and installed Second Life (it's free), created a goofy avatar (as in silly, not the Disney character...though I guess you could do that, too), and then transport on over to the new Microsoft User Group Island. It really couldn't be easier and it is a great way to get involved in the launch events if you've been unable to attend one in RL (real life, for uninitiated).

For a complete and detailed schedule of tomorrow's events, visit the Second Life DNUG website. It looks just like a real world conference schedule- the only difference is you can attend this one in your PJs. So get everything setup tonight and then come on out to the event tomorrow! If nothing else, I'll be at the event for a while and would love to meet you- look for the very normal avatar sporting the Telerik t-shirt and going by the name Bluelaser Hax.

What's cooking for Silverlight 3.0?

silverlight3Beta Even though Silverlight 2.0 has yet to see the "official" light of day, we know that the beta introduced at MIX08 represents a "feature complete" version for this release cycle. Between beta 1 and the RTM expected towards the end of summer, Microsoft will not add any major new features to the Silverlight platform. Instead, they'll focus on performance improvements, platform stability, and a number of other "polish" issues like ClientBin security.

Imagine my surprise, then, when I completed a short survey sent to attendees of MIX08 asking for input on how we'd like Microsoft to improve Silverlight. Clearly, we're talking about a version of Silverlight beyond 2.0, but nonetheless I found it interesting to see the questions on Microsoft's mind when it comes to talking about the future of their infant platform. There were plenty of questions you'd expect- Are you using Flash? Have you heard of Air? What do features do think are important in Silverlight 2?- but most interesting to me was a list of features Microsoft asked survey takers to rank.

A list of 20 possible "new features" in Silverlight was presented and we were asked to rank each as a "Must [have]", "Nice [to have]", or "Not [needed]" (I've extended the cryptic ranking descriptions for clarity). Here is the complete list of features presented:

  • Richer text control                
  • Support for spell checking                
  • Support for inline tables                
  • Support for PDF                
  • HTML rendering                
  • Printing                
  • Offline storage                
  • Local database storage                
  • Database synchronization                
  • Can install Silverlight application on desktop                
  • Access to local hard drive limited to MyDocuments                
  • Access to all of hard drive                
  • Can drag & drop from desktop to Silverlight                
  • Ability to create new Silverlight windows                
  • Support for device access such as USB                
  • Hardware accelerated graphical effects                
  • Blend modes                
  • Frame based animation                
  • Inverse kinematics / bones                
  • 3D

What makes this list very interesting is that it is from Microsoft, which means these are the features on the minds of the Silverlight development team. Some of the ideas seem inevitable, like offline storage, a richer text control, and printing support, while others really surprised me, like access to all of a hard drive and hardware accelerated graphical effects. This survey wasn't sent on April 1st (it's been sitting in my Inbox for a while), so none of these are April Fools, including access to all of a hard drive!

In fact, almost half of the features deal with adding more interaction with and access to the local computer. I know many people would love more local system access in Silverlight, but that has generally been regarded as an impossibility if Silverlight has any hopes of remaining a secure and trustable plug-in. That makes me wonder if this list represents features Microsoft really thinks it can implement or simply a collection of the most often requested features. My hope is for the prior, though I have no idea (and I'm sure MS doesn't either) how some of these features could be implemented securely.

Also interesting are the features absent on the list. Where's the interest in full .NET support? Where's the requests for easier data binding? Or how about just improved text rendering? (Or am I the only one that thinks Silverlight renders text a little blurry vs. the browser?)

So what do you think of this list? Are the features you want in the next version of Silverlight represented? If not, now's the time to start sounding-off and letting your requests be heard. Before you know it, Silverlight 2 will be official and the feature set for Silverlight 3 will already be well underway.

More Posts Next page »