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
Error while running Controller through API
-
- Posts: 1624
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Error while running Controller through API
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.
-
- Posts: 4
- Joined: Wed Jul 22, 2009 6:32 am
Re: Error while running Controller through API
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?
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Error while running Controller through API
Hello,
Please try the following dll:
http://www.yourkit.com/download/tmp/200 ... er.Api.dll
Does it solve the problem?
Best regards,
Anton
Please try the following dll:
http://www.yourkit.com/download/tmp/200 ... er.Api.dll
Does it solve the problem?
Best regards,
Anton
-
- Posts: 4
- Joined: Wed Jul 22, 2009 6:32 am
Re: Error while running Controller through API
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.
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.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Error while running Controller through API
We're investigating. We'll provide you with an update ASAP.
-
- Posts: 4
- Joined: Wed Jul 22, 2009 6:32 am
Re: Error while running Controller through API
Thats was the caspol issue i think, after adding entry in that made code to work
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Error while running Controller through API
Could you please confirm that we can close this issue as resolved?