Page view counter
Silverlight startup error with resources - Summary of fix
Last post 04-15-2008 11:17 PM by Eric Willeke. 0 replies.
Sort Posts:
04-15-2008 11:17 PM
Silverlight startup error with resources - Summary of fix

Original thread: http://silverlight.net/forums/p/11902/46857.aspx#46857

I just spent most of a day figuring out this installation error, so I thought I'd summarize for anybody with a similar problem. the problem initially manifests as an empty, white silverlight window appearing. The OnPluginError event handler is called with the following message:

Code: 4002
Type: ManagedRuntimeError
Message:

System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "SilverlightApplication2.g.resources" was correctly embedded or linked into assembly "SilverlightApplication2" at compile time, or that all the satellite assemblies required are loadable and fully signed.
   at System.Resources.ResourceManager.SearchManifestForResourceSet(String cultureName, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.GetStream(String name, CultureInfo culture)
   at System.Resources.ResourceManager.GetStream(String name)
   at System.Windows.ResourceManagerWrapper.GetResourceForType(Type typeResource, Uri xamlUri)

The local cause of the error is that the file SilverlightApplication2.obj.Debug.SilverlightApplication2.g was being embedded in the app's .dll instead.

After much searching, I've discovered that that issue appears to be related to a single file that didn't get update during one of the upgrades/installs. That file is C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.Targets. The "bad" one: 187kb modified on 9/24/2007 (3:58pm). The "good" one: 192kb modified on 9/10/2007 (1:25pm).

The times may be my installation times, not the release times... I honestly have no idea. That said, the resource generation code is remarkably different between the two. I've had multiple CTP and beta releases on my main laptop over the last six months, but the "good" version came from a clean install of VS2008 RTM, .NET 3.5, etc. in a virtual machine.

 
The fix: Copy the correct version from a clean install (I've can't attach files here) over the bad version. Switch over to Visual Studio, compile and run a silverlight 2 application, and all is good.

I've attached the correct version of the file to a post on my blog at http://manicprogrammer.com/willeke

Eric Willeke

Loading...
Joined on 04-15-2008
Indianapolis, IN
Posts 21
Microsoft Communities