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-
Error using profiler API
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Error using profiler API
Mark, please send post here
1) full exception stack trace
2) Code snippet (Controller code) which you are using
1) full exception stack trace
2) Code snippet (Controller code) which you are using
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Error using profiler API
Mark, I'm looking forward to hear from you.
-
- Posts: 2
- Joined: Wed Nov 11, 2009 3:37 pm
Re: Error using profiler API
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:
And this is as far as I've gotten with the code:
The constructor is what throws the exception. And there is an agent listening on port 10001 - I did make sure of that.
-Mark-
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:
Code: Select all
static void Main(string[] args)
{
YourKit.Profiler.Api.Controller controller = new YourKit.Profiler.Api.Controller("localhost", 10001);
}
-Mark-
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Error using profiler API
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.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Error using profiler API
Hello,
4.5.5 is available for download. It should solve the problem.
4.5.5 is available for download. It should solve the problem.
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Error using profiler API
Mark, did version 4.5.5 fix the problem for you?