How can we help you today? How can we help you today?

Database Connection Issue While Profiling

I'm new to ANTS so I may be doing something wrong that's easy to fix....but I tried doing a profiling session for a .NET Framework-based Web API hosted under IIS (all local testing for now). The profiling session starts up, but when I start calling my APIs, I keep getting a database connection error. If I don't have the profiler hooked in, the call works successfully. Any ideas why this would be happening?
JasonBock
0

Comments

7 comments

  • Russell D
    Just to clarify - everything is running on the same server as APP?
    Russell D
    0
  • JasonBock
    Yep, this is all my local dev environment.
    JasonBock
    0
  • AlexanderMz
    Hi Jason, most likely your SQL server uses Windows/AD authentication. You should run you profiler under account having access to Sql.
    Check "Show server options/Manually specify ASP account details" setting when starting profiling.
    AlexanderMz
    0
  • JasonBock
    So here's what I tried. I went into the profiling configuration and tried to change "Manually specify ASP account details".

    If I don't use the same account used for the app pool that the API runs under, I get this error (the REDACTED is client-specific info):

    [SqlException]: Cannot open database "REDACTED" requested by the login. The login failed.
    Login failed for user 'REDACTED$'.


    If I use the same account used for the app pool that the API runs under, I get this error:

    [MethodAccessException]: Attempt by security transparent method 'System.Net.Http.HttpClient.FinishSendAsync(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.

    So....not sure where to go from here. Any other ideas? Or am I not setting the profiling session up correctly?

    JasonBock
    0
  • AlexanderMz
    @JasonBock for the latter exception, find LineLevelBlacklist.xml file (%LocalAppData%\Red Gate\ANTS Performance Profiler 10\LineLevelBlacklist.xml) and put the following line there:
      <assemblyName>System.Net.Http</assemblyName>




    AlexanderMz
    0
  • JasonBock
    I'll give that a whirl...
    JasonBock
    0
  • JasonBock
    AleanderMz, that did the trick! Thanks for the help.
    JasonBock
    0

Add comment

Please sign in to leave a comment.