Running out of browser causes an exception in silverlight application - silverlight

I made a game in Silverlight application and I added it a button to install it to the computer, but when I click the install button I get this exception:
Error HRESULT E_FAIL has been returned from a call to a COM component
I used the instructions to configure an Application for Out-of-Browser from this website:
http://msdn.microsoft.com/he-il/library/dd833073(en-us,VS.95).aspx
What can be the problem?

One thing that causes this often is using the DOM bridge - it's not available OOB, so trying to access it will throw an Exception.
You can avoid that by checking HtmlPage.IsEnabled before accessing the DOM bridge.

Related

Win 8.1 Universal app - App Exit on Fast App Switching

I am developing an app for Windows Universal 8.1, facing an issue where the App gets Exit on going background. The scenarios are as follows
When the app goes background on clicking Windows key(FAS), the app get exit.
When I launch Share Task i.e Data Transfer Manager Interface, after completing the share operation the app exit.
Works fine in Debug mode but issue found after deploying to the device.
PS : I am using the Navigation Service Interface to navigate to pages using MVVM and navigating from viewmodels.
Please help if its known issue, if not help to rectify this.
Thanks in advance.
Sounds like your App crashes in The Suspending Event. As apps in Debug mode are not suspended, you are unlikely to see that happen.
You can manually fire the event from Visual Studio when debugging: It is in the debugging toolbar under Application Lifecycle Events.
Most common error in this case: Using complex objects as navigation parameters, which cannot be serialized.

Can't get Dynamic Data Display working with WPF Browser Application

Can I get Dynamic Data Display library working with WPF Browser App? I'm getting "Target Invocation Exception" when attempting to launch the app, regular desktop WPF app runs just fine.
Update 1: "That assembly does not allow partially trusted callers." is the error, got it by adding D3's chart plotter dynamically. Looking into it now.
Fixed by switching to "This is a full trust application" option in the Security tab of my project's properties. May not be appropriate for everyone, check for the potential implications of it. Did the trick for me though.

GetTempFileName not working in silverlight out-of-browser

I have a Silverlight application that runs out-of-browser. I was previously able to get the statement Path.GetTempFileName to work when I run out-of-browser but not when running locally. Now this is failing out-of-browser also.
I am getting this error
Message
File operation not permitted. Access to path '' is denied.
I am editing this because I have new information. I have another application which is very similar where I am not getting the problem. That is Path.GetTempFileName works fine. I cannot see any differences between the applications.
I need some hints as to what could be different between the two application. I am running both locally in debug.
Have you checked the Out of Browser settings in the Silverlight Project Properties page? There is a checkbox "Require elevated trust when running out of browser.
On the ShortCut not working. Try uninstalling the app from the Control panel and reinstalling. Then try it again.

What cases will prevent javascript from being executed in a WPF WebBrowser control?

We have a System.Windows.Controls.WebBrowser control rendering HTML with references to jQuery (retrieved with https connection). Our test machine recently had its Internet Explorer version upgraded to 8.0.7600.16385. After the upgrade, the WebBrowser control stopped executing javascript. We tested the same HTML in a regular browser and also in a System.Windows.Forms.WebBrowser control and it works perfectly in both.
Does anybody know what could cause?
It's probably due to security restrictions. Try to include a Mark of the Web on your page. For instance, this comment will tell the WebBrowser to execute the page with the security policy of the Local Intranet zone:
<!-- saved from url=(0016)http://localhost -->
Typically the cause for "JavaScript doesn't execute" is the browser errors while parsing or executing it: file doesn't exist, file has syntax error in it, script threw an exception while running, etc. You've attempted to rule this out by testing in a regular browser, but is there anything in the script that detects a UserAgent or browser features, and fails? Can you harvest console errors from a WPF WebBrowser control?

Silverlight Out of Browser (OOB) app crashing only on OS X

We have a Silverlight application that runs OOB (out of browser) so the user can install it. When it's running OOB we display a button that calls Application.Current.MainWindow.Close() so that the user can exit the application. This works perfectly fine on windows, but causes an error saying the application has quit unexpectedly on OS X. Anyone have any ideas why this might be? Thanks!
Found out the problem. This is apparently a "protected" action and must be done directly in response to a user action. It cannot be scheduled to happen later (we were playing an animation on the button click and then after a timer expired trying to close the window; we have to just close the window).
An exception was actually thrown on the windows version, it just never displayed any sort of message box.

Resources