I have an entire site in silverlight 4 and it works beautifully for the most part. However, on occasion, when a page is loaded, only a white screen shows up. The splash screen does not appear nor does the simple html background image I have set. If the refresh button is pressed (sometimes it needs multilple refreshes), the page loads fine. This behavior is not consistent, it only happens sporadically.
This is the company site, so I have heard reports of this happening across browser types and across computers, even in different countries.
Answer: 1
Not sure of the specifics in your case, but the javascript that handles errors does a throw new error. I alter that to do an Alert function instead. I'm not sure what the throw was supposed to do, but in every case I've seen, it does nothing. At least with the Alert, if there is an exception, you can see it.
You might also try taking a look at the Error Console in Firefox, for instance, and see if an error has been logged. I think IE has something similar, but not sure.
Answer: 2
Can you be more specific on modifying the javascript? I am not sure how to alter it to do an Alert function.
Answer: 3
Here's the javascript I use:
function onSilverlightError(sender, args) { var appSource = ""; if (sender != null && sender != 0) { appSource = sender.getHost().Source; } var errorType = args.ErrorType; var iErrorCode = args.ErrorCode; if (iErrorCode == 8001) { return } // new version required if (iErrorCode == 8002) { return } // restart required if (errorType == "ImageError" || errorType == "MediaError") { return; } var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n"; errMsg += "Code: " + iErrorCode + " \n"; errMsg += "Category: " + errorType + " \n"; errMsg += "Message: " + args.ErrorMessage + " \n"; if (errorType == "ParserError") { errMsg += "File: " + args.xamlFile + " \n"; errMsg += "Line: " + args.lineNumber + " \n"; errMsg += "Position: " + args.charPosition + " \n"; } else if (errorType == "RuntimeError") { if (args.lineNumber != 0) { errMsg += "Line: " + args.lineNumber + " \n"; errMsg += "Position: " + args.charPosition + " \n"; } errMsg += "MethodName: " + args.methodName + " \n"; } alert(errMsg); }
Answer: 4
Hi bherdrick,
I haven't encoutered this before. If you are able to reproduce it on your side, I suggest you use Fiddler to moniter when a white screen shows up if the xap file is downloade successfully or failed.
Best Regards,
Answer: 5
I upgraded a user's machine to Silverlight 5 and immediately no silverlight apps the filename matter), or it throws an error to indicate exactly what the problem is
Answer: 6
Did you add the Alert to the javascript? Did you look at Error Consoles in browsers like Firefox?
Answer: 7
Yes, I added the Alert to the javascript and looked at the Erro Console in Firefox. Neither of those did anything. It looks like the asp page is getting loaded fine, but it stalls when trying to load the xap file.
Answer: 8
Did you determine that by using Fiddler?
Really sounds odd then. The only times I've had this sort of problem was when there was some error reported by the Alert.
Is it possible that when you have this problem it is running on some super slow communication line and it is just timing out and giving up some how? Or maybe the server is getting really hammered and the request for the download can't be honored?
Just really odd. Can't think of anything else to suggest unfortunately.
Oh, have you looked at the xap in the server by copying it and renaming to zip, then opening up the client config to make sure there is nothing oddball in there?
Answer: 9
It appears that this is caused by my custom splash screen. It wasn't anything special, but when I removed it, the problem went away.
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog