Red Gate forums :: View topic - Silverlight 4 application crashes immediately
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Silverlight 4 application crashes immediately

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
davidm@boldgroup.com



Joined: 18 Jul 2012
Posts: 5

PostPosted: Wed Jul 18, 2012 8:18 pm    Post subject: Silverlight 4 application crashes immediately Reply with quote

I'm using ANTS memory profiler 7.4 and I've got a very large Silverlight 4 web application that I'd like to profile, but the browser just goes white immediately after the silverlight application is loaded. I can see the loading animation, then nothing.

This same application runs fine when not being profiled. I couldn't find much useful information in the forum for this issue. The only advice that I tried was ensuring that all iexplore.exe processes were killed before I attempted to profile.

My guess is that it has something to do with the fact that this application REQUIRES SSL since it uses web services that require transport security. I was able to get the application to start if I set the application type to 'ASP.NET web application (IIS)' AND I turned on the 'Manually specify ASP.NET account details'. This allowed the profiler to use the 'Original port (IIS will restart)' option. Without the original port selected, the application behaved exactly the same way. Of course, I'm not seeing any of the silverlight objects in my snapshot if I use this configuration.

Based on that test, I suspect that the profiler is not using the stock port, so SSL won't work, but those options are not available for the Silverlight application configuration.
Back to top
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Thu Jul 19, 2012 12:31 pm    Post subject: Reply with quote

Hello David,

Could you please try either/both of the following suggestions:

1.

Using the [.Net Executable] application type, choose iexplore.exe (Internet Explorer*) to profile.
Start profiling.
From within the instance of Internet Explorer that the profiler has started, browse to your application (this could be to the path, e.g. c:\..\index.html, or to a deployed IIS page, e.g. "https://localhost").
If web/silverlight app works take snapshots as desired.


2. This requires the Silverlight app to have Out Of Browser (OOB) support enabled.

Again using [.Net Executable] application type, choose sllauncher.exe (Silverlight Launcher^) to profile.
Change the 'Working directory' path to the .xap file of you Silverlight app in your solutions output.
Add arguments for the sllauncher.exe in the 'Arguments' control. e.g. /emulate:"<path to .xap>" /origin:"<path to .xap> /overwrite
Start profiling.
If app works, then take snapshots as normal.


* Internet Explorer default install location should be of path makeup: "C:\Program Files (x86)\Internet Explorer\iexplore.exe" depending on OS.

^ Silverlight Launcher default install location should be of path makeup: "C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe" depending on OS.
_________________
Dene Boulton
Red Gate
Back to top
View user's profile Send private message Send e-mail
davidm@boldgroup.com



Joined: 18 Jul 2012
Posts: 5

PostPosted: Thu Jul 19, 2012 4:57 pm    Post subject: Reply with quote

Hello Dene,

Thanks for your quick response. Unfortunately, neither suggestion yielded any new results.

Suggestion 1 resulted in the same Silverlight application crash as using [Silverlight 4+] application type. I can see the profiler waiting for the application to start until I browse to the correct URL, then I can see the profiler attach, then the SL application dies.

Suggestion 2 was about the same. The Silverlight launcher appears, but it is just a blank window.

Do you have any other suggestions based on this feedback?
Back to top
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Fri Jul 20, 2012 12:03 pm    Post subject: Reply with quote

Hello David,

Have you tried running the Profiler elevated as Administrator from the "get-go" ?


Btw, I previously forgot to mention why you saw no Silverlight when profiling using the ASP.Net IIS hosted option...
This is because for that application type you are profiling w3wp.exe, the IIS worker process. Whereas the Silverlight runs on the client (browser).
_________________
Dene Boulton
Red Gate
Back to top
View user's profile Send private message Send e-mail
davidm@boldgroup.com



Joined: 18 Jul 2012
Posts: 5

PostPosted: Wed Jul 25, 2012 5:04 pm    Post subject: Reply with quote

Hello Dene,

I've spent the last few days attempting to troubleshoot my profiling problems and here's what I've discovered:

First, your suggestion to run the profiler as administrator had no effect. So, in an attempt to isolate the problem, I kept removing source from my silverlight project until it was just down to the app class and a single form. Still won't run. I removed all service references, and even created a static HTML file to launch it (normally is launched from ASPX file). Still won't run. I remove the SSL requirement and launch it from a non-SSL URL. Still won't run. I start ripping out referenced assemblies and finally I can get it to run by removing System.ServiceModel.Extensions. Strange, but true. So, I restore my entire project and remove the assembly reference and it won't run again. Ugh.

Finally, I got smart and re-implemented the stock global exception handler (we had switched to using SmartAssembly to report exceptions), and I'm currently seeing the following error in the browser's javascript console ONLY when the profiler is attached, it runs fine otherwise. Why would my app be failing to load Microsoft's signed assembly when the profiler is attached?

SCRIPT5022: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
[IO.FileName_Name]
Arguments: System.ServiceModel, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.60401.00&File=mscorlib.dll&Key=IO.FileName_Name ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
at BoldTechnologies.BoldNet.Silverlight.SessionSettings..ctor()
at BoldTechnologies.BoldNet.Silverlight.App..ctor()
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Wed Jul 25, 2012 6:47 pm    Post subject: Reply with quote

Hi, Dene may have some other ideas, but out of curiosity I did a quick search through our support database for the error message you're now seeing. One other user had the same thing occur with a Silverlight application, and was able to resolve it by re-installing the Silverlight SDK.

It may just be a coincidence that they hit the same error, but also it's an option to bear in mind if we have no other ideas!
Back to top
View user's profile Send private message
davidm@boldgroup.com



Joined: 18 Jul 2012
Posts: 5

PostPosted: Wed Jul 25, 2012 11:34 pm    Post subject: Reply with quote

Thanks James, I'll give that a shot while waiting for a reply from Dene.
Back to top
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Thu Jul 26, 2012 4:19 pm    Post subject: Reply with quote

Hello,

I am interesting if James' suggestion from that previous support ticket has any beneficial effect.
I have discussed this with one of the other devs on my team (Profilers) and we cannot think why this would happen as a result of the profiler being used, as it does not alter assemblies until after they have been loaded.

It may be worth trying Sampling mode.
_________________
Dene Boulton
Red Gate
Back to top
View user's profile Send private message Send e-mail
davidm@boldgroup.com



Joined: 18 Jul 2012
Posts: 5

PostPosted: Thu Jul 26, 2012 7:08 pm    Post subject: Reply with quote

Dene and James,

Here's the latest:

I uninstalled the Silverlight 3 and 4 SDKs from my machine, reinstalled 4, started VS2010, cleaned my project and ran, no change.

So, I shut down VS2010 again, and uninstalled even more this time: Silverlight 4 tools for VS2010, F# Silverlight extensions, Silverlight 4 Control toolkit, and the Silverlight 4 developer runtime.

I reinstalled the control toolkit and the developer runtime. The tools for VS2010 wouldn't install due to some language conflict, so I figured that VS2010 would prompt me to install them as soon as I reopened my SL4 project. I wasn't prompted to install them and could still edit, run, and debug my app. I suppose they're no longer required for VS2010?

At any rate, I started ANTS memory profiler again and to my surprise my application ran under the profiler! Yay!

I know this is a lot of detail just to say that it is now working, but I'm hoping this level of detail might help someone else in the future. Thanks guys for your help, I really appreciate it.
Back to top
View user's profile Send private message
dene.boulton



Joined: 12 Oct 2011
Posts: 53
Location: Cambridge

PostPosted: Fri Jul 27, 2012 10:29 am    Post subject: Reply with quote

Good morning David,

Thank you for the detail - it is always beneficial to have this on record incase another user comes up against something similar in the future.

(And) It is good news that you have the Profiler working for your application. Smile
_________________
Dene Boulton
Red Gate
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group