15

My Silverlight website hangs at 100% loaded. There is no code for it, so far it is just the design in XAML, and it shows up fine in Expression Blend 3. It is the standard "Silverlight Website" project from Blend 3, without any modifications.

When I press F5 to run it, it shows as a 100% loading circle in firefox and never actually shows my app. The loading circle continues to animate as if its doing something.

Note: It worked yesterday, and I havent made very many changes to it since then.

Kyle
  • 21,377
  • 37
  • 113
  • 200

9 Answers9

4

I had this problem in browser, out of browser - even when debugging. Using Silverlight 4 beta.

I hit F5 to start debugging and it never even hit a breakpoint for the constructor of App.xaml.cs.

I knew I'd uninstalled an out of browser app and changed some out of browser settings recently but nothing would tell me the actual problem.

I found in the end if I ran in IE (normally I use Chrome) - then an error icon would be shown in the bottom left - as if it were a javascript error.

Webpage error details

Message: Unhandled Error in Silverlight Application 
Code: 2020    
Category: ParserError       
Message: Invalid Property: OutOfBrowserSettings.     
File:      
Line: 47     
Position: 27     

Line: 54
Char: 13
Code: 0
URI: file:///R:/Project/Projece/Bin/Debug/TestPage.html

Well this didn't get me any further - except to tell me something was messed up with OutOfBrowserSettings.

What I ended up doing was creating a new AppManifest.xml. As of Silverlight 4 this is the default AppManifest.xml.

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
    <Deployment.Parts>
    </Deployment.Parts>
</Deployment>

I disabled 'create app manifest' and reenabled it. After toggling some of the settings back and forth - and even creating AppManifest2.xml I managed to get it working again.

I switched back to my original AppManifest.xml and it worked.

The point being check any message the browser gives you - and then change things that you don't think will make a difference.

Good luck!

Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
3

I figured out the problem after looking at the XAML. On the height property of one of my buttons, there was a line break right before the ending quote. Expression blend didn't mark it as an error, and everything showed up fine in design mode.

When I removed the line break, the loading problem was fixed.

Kyle
  • 21,377
  • 37
  • 113
  • 200
  • Can you post your xaml code to into the question, I'm interested in this error. – Ekk Oct 30 '11 at 12:33
3

My other answer looks quite convoluted compared to this. This may or may not help in this situation but its worth a try:

In Visual Studio :

  • Click Debug > Exceptions
  • Click 'Find' and search for XAML
  • Click the 'Thrown' button next to System.Windows.Markup.XamlParseException

Start your project in debug mode. Any Xaml exceptions will be shown immediately. Check the inner exception sometimes for further information.

I wasted soooo much time before I finally figured this one out!

Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
2

Here is the answer: http://www.cnblogs.com/101rico/archive/2012/11/14/2769781.html

You can add this: xmlns:Grid="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
Rico
  • 21
  • 1
1

This also happens when the Silverlight app requires Silverlight 5, but the user has a lower version installed.

JoeCool
  • 4,392
  • 11
  • 50
  • 66
1

An infinite event loop can cause this problem:

private void myComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    myComboBox.SelectedIndex = 0;
}
basscode
  • 11
  • 1
1

If it is an elevated trust application, failing to have the necessary registry settings set to allow its launch can cause the dreaded "100% hang":

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Silverlight

AllowElevatedTrustAppsInBrowser DWORD:=1 AllowLaunchOfElevatedTrustApps DWORD:=1

zax
  • 844
  • 8
  • 14
0

Open Internet Explorer, go to Tools-> Internet Options->Advanced->click Reset on Reset Internet Explorer Settings-> choose Delete Personal Settings->Click reset

0

So my problem was, in a data grid, I had a duplicate column name binding to the same column name. So something in the xaml was crazy messed up. Apparently the control I am using had an "Internal Exception" that was not being thrown up on the screen as an error.

Omzig
  • 861
  • 1
  • 12
  • 20