azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Unable to debug v4 .Net 6 Isolated Function from Visual Studio 2022 with AzureFunctionTools 4.19.0

Open willyt150 opened this issue 3 years ago • 7 comments

Experiencing this issue on multiple machines with different Visual Studio 2022 versions. VS 17.2.3 and 17.2.6

Had existing .Net 6 Isolated functions that we've been working on and debugging locally since the beginning of the year. Today when attempting to debug (via F5) it hung waiting for VS to attach debugger, and then eventually gave up.

image

Figured out that it's related to AzureFunctionTools 4.19.0 bits that were auto downloaded today, resulting in: Core Tools Version: 4.0.4670 Commit hash: N/A (64-bit) Function Runtime Version: 4.7.2.18626

Since I have been unable to figure out how to tell VS to NOT auto download and use 4.19.0, any attempts deleting the folder cause it to be recreated, I have tried following the concept in this SO, I replaced the contents of the 4.19.0 folder with the contents from my 4.16.0 folder (except the manifest.json, which I left as is).

I was then able to successfully debug the functions again.

I did also figure out that with 4.19.0, if I ran the function without debugging and then attached to the process after the fact, it worked successfully.

Both the attach to process workaround and the folder contents hack are not approaches I want to have to do.

How do I tell Visual Studio to stick with using the 4.16.0 folder instead of downloading latest?

willyt150 avatar Jul 29 '22 23:07 willyt150

Thanks for reporting @willyt150. We reverted the change in https://github.com/Azure/azure-functions-tooling-feed/pull/374. Let us know if you're still seeing the issue

ejizba avatar Jul 29 '22 23:07 ejizba

@ejizba Thank you so much for the quick resolution!

That has resolved the issue for me.

Do you know if there's a way for local debugging in VS to tell it which version to use explicitly?

willyt150 avatar Jul 29 '22 23:07 willyt150

Going to keep this issue open as we still need to fix the issue for future releases

Do you know if there's a way for local debugging in VS to tell it which version to use explicitly?

Unfortunately I don't think there is a way. I would have to follow up with the VS team

ejizba avatar Jul 29 '22 23:07 ejizba

Ok, sounds good. Thanks

willyt150 avatar Jul 29 '22 23:07 willyt150

Hi, just hit this issue yesterday, after reading this, I reinstalled the Azure Core Tools with the msi installer, just in case.. but it still happening...

RoygarBriceno-Arkano avatar Aug 02 '22 13:08 RoygarBriceno-Arkano

@RoygarBriceno-Arkano the version of the Azure Core Tools that Visual Studio is using isn't the one installed (via MSI or NPM) it downloads it's own version into C:\Users\{user}\AppData\Local\AzureFunctionsTools\Releases (doing this from memory so hopefully I got it correct).

While the rollback just worked for me, a coworker couldn't get it working until he deleted the entire "Releases" folder and restarted VS, maybe that will work for you?

willyt150 avatar Aug 02 '22 14:08 willyt150

Thanks @willyt150 , you were pretty close with the path, is C:\Users\ {user}\AppData\Local\AzureFunctionsTools\Releases

And yes, deleting the "Releases" folder and restarting visual studio solved the issue

RoygarBriceno-Arkano avatar Aug 02 '22 14:08 RoygarBriceno-Arkano