Webjobs

tschlarmtschlarm Posts: 23 Bronze 2
edited September 26, 2018 9:37PM in ANTS Performance Profiler
Does ANTS PP work with line level timings of an Azure webjob? I have a relatively vanilla scheduled webjob (using async/await) and while calling:

HttpResponseMessage resp = await httpClient.PostAsync(<myurl>, content);

it throws:

Attempt by security transparent method 'System.Net.Http.HttpClient.FinishSendAsyncBuffered(System.Threading.Tasks.Task`1<System.Net.Http.HttpResponseMessage>, System.Net.Http.HttpRequestMessage, System.Threading.CancellationTokenSource, Boolean)' to call native code through method '<Module>._ANTS_Begin_Async()' failed.  Methods must be security critical or security safe-critical to call native code.

I found an old reference to this in the forums about a Silverlight app that threw the same message.
https://forum.red-gate.com/discussion/77766/error-when-starting-silverlight-profiling-session

I don't want to blacklist the exe since that's what I'm trying to profile. I don't see [AllowPartiallyTrustedCallers] attribute in my code anywhere (unless it's implied by the webjobs SDK). And turning off the async awareness support and running it crashed ANTSPP (I submitted the report w/ my email).

dotTrace allows the task to run and profile just fine.

Any ideas?
Tagged:

Answers

  • I'm afraid we didn't receive your error report. Could you attach it here or try again?
    Have you visited our Help Centre?
  • tschlarmtschlarm Posts: 23 Bronze 2
    Not sure it's around any more. I just let the built-in error reporting send it. Not sure where it went. Trying to repro this and so far this morning the crash isn't happening.

    What I've found so far with ANTSPP v10.1.1067:
    With async awareness enabled:
    - Sample method level timings (inc framework): works
    - Method-level timings (only methods with source): fails
    - Line-level and method level: fails
    - Method levels (inc framework): fails
    - Line & Method level: fails

    With async awareness disabled:
    - Sample method level timings (inc framework): works
    - Method-level timings (only methods with source): works
    - Line-level and method level: fails
    - Method levels (inc framework): works
    - Line & Method level: fails

    As for other profiler options everything checked except the 1st option (Record File i/O performance)

  • Ok - at this stage no I'm afraid we don't support profiling Azure Webjobs - assuming you are meaning https://docs.microsoft.com/en-us/azure/app-service/web-sites-create-web-jobs.

    We'll look into this after we've gotten SA out of the door, but no ETA or promises I'm afraid.
    Have you visited our Help Centre?
  • tschlarmtschlarm Posts: 23 Bronze 2
    This is running a webjob locally and not attaching to a process running in the cloud. dotTrace runs it fine, though their GUI is tough to interpret the results. 
Sign In or Register to comment.