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

Open
TonyHenrique opened this Issue Jun 17, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@TonyHenrique
Copy link

TonyHenrique commented Jun 17, 2018

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

TonyHenrique commented Jun 19, 2018

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

@TonyHenrique

This comment has been minimized.

Copy link

TonyHenrique commented Jun 19, 2018

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

jeromekol commented Jul 20, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

jeromekol commented Jul 24, 2018

thx @safihamid that worked for me!

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