Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Error while running Controller through API

Moderators: Vladimir Kondratyev, Anton Katilin

Error while running Controller through API

Postby ankushb » Wed Jul 22, 2009 6:39 am

Hi,

I was trying to run yourkit profiler through api. The problem is when I try to instantiate new Controller object using
Controller controller = new Controller();

Its giving runtime error
Unhandled Exception: System.Exception: To use the profiler API, run the application with YourKit Profiler
at YourKit.Profiler.Api.AgentPortRetriever.getNetAgentPort()
at YourKit.Profiler.Api.Controller..ctor()

YourKit.Profiler.Api.Dll is in the refernece path. Am i missing some other reference? I am using VS2008 on vista.

Thanks
Ankush
ankushb
 
Posts: 4
Joined: Wed Jul 22, 2009 6:32 am

Re: Error while running Controller through API

Postby Vladimir Kondratyev » Wed Jul 22, 2009 8:04 am

The exception text says "To use the profiler API, run the application with YourKit Profiler". It doesn't mean that you need to have profiler agent in PATH. It means that the current process itself should be launched with profiler agent. Please refer the help. If you write an application which doesn't run with profiler agent itself, but controls profiling in other application, you should use Controller(String, Int32) constructor.
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Error while running Controller through API

Postby ankushb » Wed Jul 22, 2009 11:14 am

Sorry to bother you again, When I am adding yourkit.api.dll as reference in my project(note its not console application, it doesn't generate the exe rather generate the dll which is used by another application) VS2008 is giving error "Assembly generation failed -- Referenced assembly 'YourKit.Profiler.Api' does not have a strong name". How to get rid of this?
ankushb
 
Posts: 4
Joined: Wed Jul 22, 2009 6:32 am

Re: Error while running Controller through API

Postby Anton Katilin » Wed Jul 22, 2009 12:05 pm

Hello,

Please try the following dll:

http://www.yourkit.com/download/tmp/200 ... er.Api.dll

Does it solve the problem?

Best regards,
Anton
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Error while running Controller through API

Postby ankushb » Wed Jul 22, 2009 12:30 pm

Using this dll code gets compiled but while starting the controller it is giving error

Error while starting profiler
System.IO.FileLoadException: Could not load file or assembly 'YourKit.Profiler.Api, Version=4.0.7.420, Culture=neutral, PublicKeyToken=14709304d0c5eb15' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)
File name: 'YourKit.Profiler.Api, Version=4.0.7.420, Culture=neutral, PublicKeyToken=14709304d0c5eb15' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.
ankushb
 
Posts: 4
Joined: Wed Jul 22, 2009 6:32 am

Re: Error while running Controller through API

Postby Anton Katilin » Wed Jul 22, 2009 3:23 pm

We're investigating. We'll provide you with an update ASAP.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Error while running Controller through API

Postby ankushb » Thu Jul 23, 2009 5:30 am

Thats was the caspol issue i think, after adding entry in that made code to work
ankushb
 
Posts: 4
Joined: Wed Jul 22, 2009 6:32 am

Re: Error while running Controller through API

Postby Anton Katilin » Thu Jul 23, 2009 9:34 am

Could you please confirm that we can close this issue as resolved?
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 1 guest

cron