共用方式為


Working on updating my Silverlight 2.0 stuff to RTM

And of course there would have to be an error that I had to work around... I had built several samples with the pre-release stuff of Silverlight 2.0 and just started the processing of updating my environment. So I uninstalled everything in my dev environment related to silverlight and started over. This included Visual Studio 2008 SP1, Expression Blend 2 SP1, as well as the new Silverlight Tools for Visual Studio. After getting everything in the environment, I created a simple Silverlight app along with the default web test application...and my Hello World demo gave me a wonderful parser error saying it couldn't find the Silverlight assembly.

I checked the reference and it was point to the correct dll. If I changed the setting for this to copy local then it would work fine, but i didn't want tons of copies floating around on my dev machine. I used gacutil and installed it into the Global Assembly Cache - same error. Interesting, if I changed the Register directive in the aspx page then so that it specified the strong name of the assembly then it worked. But I didn't want to have to do this for every aspx page or project that I create... So the end state solution I came up with was to add the assembly reference in the framework's root web.config file. This is located at: C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG. It is called web.config. The additional line I added was an assembly directive:
<add assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

 I still haven't gotten to my previous projects, but at least Hello World works now :)

Comments