Silverlight 4 OOB blank screen - silverlight

I have a working web application which I want to use as OOB;
However, when I install it, all I get is a blank screen and nothing more...
I also tried without any javascript or HtmlPage.Methods invokes, but still the same
Please help

(A very late reply but the solution wasn't easily available so posting this to help anyone who needs help on this) I was having a problem with the white screen happening when launching OOB apps in debug mode. From lots of searching it appeared that the white screen occurs when an exception is thrown during the application start. Hence the app appearing to load correctly at first and then suddenly going to white screen. I found that the following line of code from the default business app template (from Application_Startup in App.xaml.cs) was causing the exception in OOB mode when using forms authentication:
WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);
Commenting out the line of code immediately made the white screen problem go away.

Make sure you are running the app in debug mode (set it to start in OOB from the project settings and set the project and not the website to be the startup project). If you do that, you should be able to step into where the problem occurs.
(https://forums.silverlight.net/forums/t/190044.aspx)

It's difficult to say what is wrong in your case because you haven't provided any sources, but you can use this article as a reference Building An Out-of-Browser Client With Silverlight 3

Maybe you're trying to interact with page right before InitializeComponent() call in constructor of your main UserControl. If some exception occured before InitializeComponent() then you'll receive blank screen.

Related

Debug XBAP hosted in WPF Application

I have a WPF Application (say, WPF.exe) with multiple tabs. In one of the tabs, I display a *.xbap using: WebBrowser tag.
<WebBrowser Source="c:/PublishedWebSites/Test.xbap"/>
When I start WPF.exe, I am able to attach debugger to any other UserControl but not to my XBAP. I also tried attaching my XBAP to PresentationHost.exe process which was started when I click on the browser tab.
The break points are not hit in XBAP project, though I verified that when I publish the XBAP, I oublish *.pdb files as well.
Could anyone tell me what I am doing wrong here?
Thanks,
RDV.
I could debug. Steps:
1. Compile and Publish XBAP. DO NOT change anything after publishing.. in case you do.. republish it.
2. Ensure there are no PresentationHost.exe processes running.
3. Run the WPF application. Launch XBAP (as one of the tabs ..in my case).
4. Debug->Attach to process-> Connect to PresentationHost.exe=> ensure that you select the correct 32 vs 64 version (i think this was my mistake).
Thanks,
RDV

Exceptions in WPF Word Addin are not being handled

I am creating a WPF Office add in, and I would like to handle all exceptions in one place. To do this I use the following code in the constructor of my MainWindowViewModel:
Dispatcher.CurrentDispatcher.UnhandledExceptionFilter += new
DispatcherUnhandledExceptionFilterEventHandler(HandleAllException);
In my test environment I host the WPF app from a console application project, and exceptions are handled as expected. When I host the WPF app from within word however, nothing happens when exceptions are thrown. There is no notification at all that there has even been an exception, other than in the output window in visual studio. Does anyone have any suggestions as to what I might be doing wrong?
I have solved the problem by changing the way in which I launch my WPF app. I believe the problem was related to this.

Codeplex sample browser - what UI technology is it?

Codeplex has a strange application for downloading and browsing Windows samples, and I have not been able to understand just what it is:
http://1code.codeplex.com/releases/view/64539
When the click-once application above is installed, it creates a single file in the form of a shortcut which contains the following line only:
http://1code.codeplex.com/releases/clickonce/SampleBrowser.application#SampleBrowser.application, Culture=neutral, PublicKeyToken=48e4844f2d49d017, processorArchitecture=msil
Then, when this shortcut is double-clicked, a sort of browser application comes up, but it has no window borders and is very modern looking. What type of technology is this? I am including the WPF tag otherwise I am at my wit's end as to what it is.
(Wanted to include an image of the said application here but can't seem to upload an image as I am getting the following error: "Failed to upload image; imgur is rejecting the request") Here's a link to that image: http://imgur.com/B38P6
Thanks.
The initial part about the odd link is simply a click-once application. The rest of the application is hidden away somewhere in your user directory.
The "browser" is simply a window which has had its chrome modified. Could be pretty much any technology. A couple examples in winForms and wpf.
As a caution, if doing a custom chrome in wpf don't use the AllowTransparency="True" if you want your comboboxes and such to work properly on XP.

Silverlight project won't enter debug mode

My Silverlight project in VS 2010 has stopped entering debug mode. Even if I set a breakpoint in the constructor of the Application class, it refuses to hit any breakpoints. My other projects are still fine, but I can't find any setting that may have accidentally gotten changed to keep me from debugging. What could be going on?
Open the properties of the associated Web Project. Select the Web Tab. Scroll to the bottom and in the "Debuggers" section make sure "Silverlight" is Checked.
Not sure what happened, but here's what got it working again.
I changed it to Release mode, compiled it. Closed and restarted VS, changed it back to Debug mode, ran it and breakpoints hit again.
Make sure the dropdown in the toolbar is set to Debug and not Release
While Attaching the process please attach w3p.exe and iexplorer instance of Silverlight this should resolve your issue.

Silverlight hangs at 100% loaded

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.
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!
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.
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!
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"
This also happens when the Silverlight app requires Silverlight 5, but the user has a lower version installed.
An infinite event loop can cause this problem:
private void myComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
myComboBox.SelectedIndex = 0;
}
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
Open Internet Explorer, go to Tools-> Internet Options->Advanced->click Reset on Reset Internet Explorer Settings-> choose Delete Personal Settings->Click reset
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.

Resources