This is a migrated thread and some comments may be shown as answers.

Profiler and Tuning Advisor for Silverlight App?

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Garrett
Top achievements
Rank 1
Garrett asked on 15 Jul 2011, 05:38 AM
Hi,

I'm trying to figure out how to attach the OA Profiler to a Silverlight4/Web app for real-time monitoring.

The tutorial (located here: http://www.telerik.com/help/openaccess-orm/openaccess-profiler-how-to-configure-project-real-time-profiling.html)

...does not work correctly when trying to attach it to the web application. After following the directions exactly, I get this error:

"Error    2    'Telerik.OpenAccess.ServiceHost.ServiceHostManager.StartProfilerService(int)' is a 'method' but is used like a 'type'    C:\Users\Garrett\documents\visual studio 2010\projects\RadControlsSilverlightApp4\RadControlsSilverlightApp4.Web\Class1.cs    11    59    RadControlsSilverlightApp4.Web"

Here is my code:
namespace RadControlsSilverlightApp4.Web
{
    public class Class1
    {
        Telerik.OpenAccess.ServiceHost.ServiceHostManager.StartProfilerService(15555);
    }
}

Is what I'm doing not possible?

Thanks,

Garrett

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 15 Jul 2011, 11:42 AM
Hi Garrett,

As it is mentioned in the help article, the best place to start and stop the server is the Global class and its Application_Start and Application_End methods. If you do not have this class in your project already, you can add it from the project's context menu -> Add -> New Item and then select the Global Application Class template from the Web category.
The last thing you need to do is call the StartProfilerService and StopProfilerService methods. At the end the Global class should look like this:
public class Global : System.Web.HttpApplication
{
 
    protected void Application_Start(object sender, EventArgs e)
    {
        Telerik.OpenAccess.ServiceHost.ServiceHostManager.StartProfilerService(15555);
    }
 
    protected void Session_Start(object sender, EventArgs e)
    {
 
    }
 
    protected void Application_BeginRequest(object sender, EventArgs e)
    {
 
    }
 
    protected void Application_AuthenticateRequest(object sender, EventArgs e)
    {
 
    }
 
    protected void Application_Error(object sender, EventArgs e)
    {
 
    }
 
    protected void Session_End(object sender, EventArgs e)
    {
         
    }
 
    protected void Application_End(object sender, EventArgs e)
    {
        Telerik.OpenAccess.ServiceHost.ServiceHostManager.StopProfilerService();
    }
}

Hope that helps.

Best wishes,
Alexander
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
General Discussions
Asked by
Garrett
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or