Profiling Silverlight app that's hosted inside an exe

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Profiling Silverlight app that's hosted inside an exe

Postby ergu » Tue Nov 29, 2011 4:36 am

Is there a way to do this with the ANTS Memory Profiler?

I have a silverlight app that's hosted within an active x control within an exe. I only see the option to start a silverlight app by using a URL or by selecting a xap.

Thanks!
ergu
 
Posts: 6
Joined: Tue Nov 29, 2011 4:32 am

Postby Brian Donahue » Thu Dec 01, 2011 11:17 am

I'm afraid I don't know enough about this particular configuration to answer the question, but provided that Silverlight Runtime is the only loaded .net runtime, I think it may work to profile the application as a regular desktop application.

Profiler only "supports" profiling SL hosted in a browser or by sllauncher.exe when you specify a XAP file.

I'll let development know about this topic and they should have enough knowledge of the undocumented features of Profiler to provide a solid answer.

EDIT: Yes, I'm told profiling your application as a .NET executable will work. However as I mentioned before, if the app loads both .NET Runtime and Silverlight Runtime you will get results for one or the other but not both.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ergu » Thu Dec 01, 2011 8:29 pm

Thanks for the response.

For my specific case: I am trying to profile a SL app hosted in an Active x control in Excel so there should only be the SL runtime.

How does ANTS launch the exe? The add in doesn't work when launching excel from the profiler but works otherwise.
ergu
 
Posts: 6
Joined: Tue Nov 29, 2011 4:32 am

Postby Brian Donahue » Fri Dec 02, 2011 10:21 am

Okay, so this is not an information request, it's a problem with Profiler actually not working.

Well, make sure you have AMP v7.2 and contact us again if you do. I'm going to have to get the development team to investigate why the memory profiler isn't working with Excel add-ins (this time). *sigh*
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby AndrewH » Mon Dec 05, 2011 12:39 pm

The profiler starts the executable you supply using Process.Start and some extra environment variables that tell .NET to load the profiler and which process to attach to. Provided the variables aren't unset, the profiler will be loaded into the CLR whenever it starts (even if it's in a process launched by the one you initially specify)

Can you give more details about how the addin doesn't work? If it fails to load, then it's probably something to do with the way Excel is being started. If Excel crashes when you try to use it, there's a good chance that you've found a bug in the profiler core. If it works but doesn't profile, the chances are that the variables have got cleared somehow before the add-in started, or the profiler didn't load for some reason (unfortunately, this is the hardest kind of problem to narrow down, as there's little feedback from .NET on what happened).

Older versions of the profiler did have some issues with Excel - specifically to do with Data Execution Prevention - they would crash when you took a snapshot, though profiling would work OK otherwise. This should have been fixed in version 7.1, however, so I'm interested if this still occurs in newer versions.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 0 guests