Skip to content

The Debugging is not hitting the Breakpoint when Remote Debugging using Visual Studio 2017 #844

Closed

Description

I published a Debug version of Azure Function (v2, C#, precompiled)

The Debugging is not hitting the Breakpoint when Remote Debugging
If I run locally, then Debugging works as expected.

It seems that I am unable to remote debug Azure Functions V2 C# precompiled, using Visual Studio, the debugging sessions starts, but the breakpoints does not hit

I noticed this message

The current version of VS Remote Tools does not match this version of Visual Studio. If errors occur, try installing the matching version of VS Remote Tools.

I installed https://aka.ms/vs/15/release/RemoteTools.amd64ret.enu.exe but still have this same problem.

I am using
Azure Functions v2 Runtime version: 2.0.11857.0 (beta) and Visual Studio 2017 15.8.0 Preview 2.0

Activity

  1. cgillum commented on Jun 18, 2018

    @cgillum
    Member

    Have you checked the Modules window to see if your symbols are getting loaded?

    Regarding the message you saw, it's possible the issue is related to your use of VS 2017 15.8.0, which is currently in preview, and thus we might not have the right server-side components installed. Henry Hamid Safi (@safihamid) do you know if the remote debugging bits we have today work with this prerelease version of VS?

  2. safihamid commented on Jun 18, 2018

    @safihamid

    I just tested this using 15.8.0 Preview 2.0 out of the box and everything worked fine for me. I didn't need to install any additional remote tools. I suggest you uninstall the remote tools package from your client and see if it works or not. Also using Runtime version: 2.0.11857.0 (beta) .

  3. TonyHenrique commented on Jun 18, 2018

    @TonyHenrique
    Author

    After uninstalling Remote Tools

    When I Attach Debugger, this appears

    System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named 'webapius.azurewebsites.net'. A conexão com o ponto de extremidade remoto foi encerrada.

    at Microsoft.VisualStudio.Debugger.Interop.Internal.IDebuggerInternal120.ConnectToServer(String szServerName, VsDebugRemoteConnectOptions[] pConnectOptions, CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount, IDebugCoreServer3& ppServer)
    at Microsoft.VisualStudio.Web.Azure.MicrosoftWeb.Operations.RemoteDiagnosticsSessionBase.ConnectToServer(String site, String user, String password)

    Then I installed it again, but still have this error. Can not start Debugging session.

    If I try to start debugging on the next Function (webapiusv2 in that piture), then it starts the debugging session.

    can not start debugging

    image

  4. TonyHenrique commented on Jun 19, 2018

    @TonyHenrique
    Author

    Chris Gillum (@cgillum) I checked now the Modules
    My assembly WebAPI.dll has Symbols loaded.
    image

  5. TonyHenrique commented on Jun 19, 2018

    @TonyHenrique
    Author

    I don't know how, but now the debugging is worked again, that error window is not appearing anymore.
    Breakpoint hits.
    Then after a few attempts, breakpoint does not hit again.

  6. TonyHenrique commented on Jun 19, 2018

    @TonyHenrique
    Author

    Another thing, sometimes when right click the Function on Azure Server Explorer and select Attach Debugger,
    this error appears
    Object reference not set to an instance of an object.
    image

  7. jeromekol commented on Jul 20, 2018

    @jeromekol

    I got the same problem and using Azure Functions and Web Tools 15.0.40617.0. I'm running my app on an app service plan and not even the modules are loaded from my function app.

  8. safihamid commented on Jul 23, 2018

    @safihamid

    Jerome Koller (@jeromekol) There is a bug in VS Cloud Explorer for functions V2 that will be fixed soon. But when manually attaching make sure in the 'Attach to:' when clicking the 'Select...' button you pick 'Managed (CoreCLR) code'.

    image

  9. jeromekol commented on Jul 24, 2018

    @jeromekol

    thx Henry Hamid Safi (@safihamid) that worked for me!

  10. StingyJack commented on Feb 22, 2019

    @StingyJack

    This worked last week and does not work today. I get the same message in the output window -> Diagnostics Hub from both Server explorer and Cloud explorer. Mathew Charles (@mathewc) - can this be reopened?

  11. vjppaz commented on May 18, 2021

    @vjppaz

    Jerome Koller (@jeromekol) There is a bug in VS Cloud Explorer for functions V2 that will be fixed soon. But when manually attaching make sure in the 'Attach to:' when clicking the 'Select...' button you pick 'Managed (CoreCLR) code'.

    image

    I am trying this step but i receive an invalid credential exception. what cred should i use? i tried my ms 365 account but it doesn't recognize it, i am the owner of the subscription.

  12. RDavis3000 commented on May 18, 2024

    @RDavis3000

    Jerome Koller (@jeromekol) There is a bug in VS Cloud Explorer for functions V2 that will be fixed soon. But when manually attaching make sure in the 'Attach to:' when clicking the 'Select...' button you pick 'Managed (CoreCLR) code'.
    image

    I am trying this step but i receive an invalid credential exception. what cred should i use? i tried my ms 365 account but it doesn't recognize it, i am the owner of the subscription.
    I found these instructions helpful:
    https://turbo360.com/blog/remote-debugging-azure-functions-in-visual-studio-2022#:~:text=How%20to%20remote%20debug%20an%20HTTP%20trigger%20Azure,message%20to%20your%20HTTP%20trigger%20Azure%20Function%20

    1. Download your Publish Profile
    2. Open it in Notepad (or similar) and find the userName and userPWD fields
    3. Use those in the credentials challenge

    NB:// the userName will be in various formats in the file for different profile types, use the one which looks like function-app-name$function-app-name

  13. safihamid commented on May 20, 2024

    @safihamid

    By any chance you have Basic Auth disabled for your site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions