 |
|
|
|
When in Beta, Not all Locales are Created Equal?
|
|
|
 |
|
Location: Blogs Andy's Blog |
|
| Posted by: host |
3/18/2008 4:11 PM |
I ran into an odd Silverlight Beta 1 problem after releasing the latest version of "Sort the Foobars" - the game worked fine for me in testing, but shortly after putting it up on this site I received several comments about it crashing in different locales, like Russian and French (you can see those comments here)
The exception looked something like this:
Silverlight error message ErrorCode: 4002 ErrorType: ManagedRuntimeError Message: System.Exception: Défaillance irrémédiable (Error 0x1709. Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=mscorrc.dll&Key=0x1709 0x8000FFFF (E_UNEXPECTED)) at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, String s) at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, Object obj) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
So the first question is, how do you set up your development machine to test the other locales? It turns out this part is easy - go to Control Panel/Regional Settings and set the language to, say Russian.
After doing that, I found that this was the line of code that was dying:
this.SetValue(Canvas.LeftProperty, X)
Not much to that… “this” is a UserControl and (here is the key part!) “X” is a float. So apparently, setting the left property to a float is bad outside of en-us J
I added a Convert.ToDouble(X) in there and it seems happy now:
this.SetValue(Canvas.LeftProperty, Convert.ToDouble(X))
So the moral of the story? I think that the different behavior is hopefully because this is still a Beta release of Silverlight... Because we would really hope for consistent behavior between Locales! But on the other hand, you still need to be careful with setting Dependency properties to types that they aren't suited for!
|
|
| Permalink |
Trackback |
Comments (3)
Add Comment
|
Re: When in Beta, Not all Locales are Created Equal?
|
By Anonymous on
3/18/2008 5:41 PM
|
|
People were having the same issue with the 2.0 version of the Farseer Demos...
|
|
|
Re: When in Beta, Not all Locales are Created Equal?
|
By Anonymous on
3/20/2008 4:30 AM
|
|
In "Destroy all Invaders", I keep getting the ErrorCode: 5014 -- ErrorType: ParserError -- Message: illegal xml character -- XamlFile: ClientBin/Destroy/AllInvaders.xap -- Line: 1 -- Position: 3
|
|
|
Re: When in Beta, Not all Locales are Created Equal?
|
By Anonymous on
3/20/2008 7:18 AM
|
|
For the ErrorCode:5014 - do the rest of the demos and games work for you? Like Silverlight Rocks! and Sort the Foobars?
|
|
|
|
 |
|
 |
|
|