Error using profiler API

Questions about YourKit .NET Profiler
Post Reply
markjhvt
Posts: 2
Joined: Wed Nov 11, 2009 3:37 pm

Error using profiler API

Post by markjhvt »

We're trying to automate some profiler runs. So, I've set the appropriate environment variables to enable the profiling agent. That works fine - the log file shows the agent is listening. Plus, viewing open ports on the system reveals the process is listening on port 10001.

However, when I try to use the .Net API to connect to the process (using the Controller class), I get the following exception:

Communication with failed.
The response contains incorrect data.
Unexpected null string

However, the UI is able to connect to the application just fine.
Any reason why the API is having a hard time connecting to the application?

-Mark-
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Error using profiler API

Post by Vladimir Kondratyev »

Mark, please send post here

1) full exception stack trace
2) Code snippet (Controller code) which you are using
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Error using profiler API

Post by Vladimir Kondratyev »

Mark, I'm looking forward to hear from you.
markjhvt
Posts: 2
Joined: Wed Nov 11, 2009 3:37 pm

Re: Error using profiler API

Post by markjhvt »

Sorry I took so long to reply. I got involved in helping with a production issue, which we eventually found with the help of your profiler.

So, here is the full exception with stacktrace:

Code: Select all

System.Exception was unhandled
  Message="Communication with failed.\nThe response contains incorrect data.\nUnexpected null string"
  Source="YourKit.Profiler.Api"
  StackTrace:
       at YourKit.Profiler.Api.Packet.readStringNotNull(Stream inputStream)
       at YourKit.Profiler.Api.Controller..ctor(String host, Int32 port)
       at ProfilerTest.Program.Main(String[] args) in C:\Users\mhenry\Documents\Visual Studio 2008\Projects\ProfilerTest\ProfilerTest\Program.cs:line 12
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
And this is as far as I've gotten with the code:

Code: Select all

        
static void Main(string[] args)
        {
            YourKit.Profiler.Api.Controller controller = new YourKit.Profiler.Api.Controller("localhost", 10001);

        }
The constructor is what throws the exception. And there is an agent listening on port 10001 - I did make sure of that.

-Mark-
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Error using profiler API

Post by Vladimir Kondratyev »

We have managed to reproduce the problem. This bug will be fixed in upcoming version 4.5.5. Most probable it will be released today.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Error using profiler API

Post by Anton Katilin »

Hello,

4.5.5 is available for download. It should solve the problem.
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Error using profiler API

Post by Vladimir Kondratyev »

Mark, did version 4.5.5 fix the problem for you?
Post Reply