Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TonyHenrique opened this issue Jun 17, 2018 · 11 comments

Comments

@TonyHenrique
Copy link

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

@cgillum
Copy link

cgillum commented Jun 18, 2018

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. @safihamid do you know if the remote debugging bits we have today work with this prerelease version of VS?

@safihamid
Copy link

safihamid commented Jun 18, 2018

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) .

@TonyHenrique
Copy link
Author

TonyHenrique commented Jun 18, 2018

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

@TonyHenrique
Copy link
Author

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

@TonyHenrique
Copy link
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.

@TonyHenrique
Copy link
Author

TonyHenrique commented Jun 19, 2018

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

@jeromekol
Copy link

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.

@safihamid
Copy link

safihamid commented Jul 23, 2018

@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

@jeromekol
Copy link

thx @safihamid that worked for me!

@StingyJack
Copy link

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. @mathewc - can this be reopened?

@vjppaz
Copy link

vjppaz commented May 18, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants