Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2019 - Unable to debug Azure functions - (Desktop CLR (.NETFramework) versus Managed (CoreCLR)' debugger

I have installed the Visual Studio 2019 community version 16.4.4 on a brand new laptop

OS:- Windows 10 Home Single Language

The following are the .NET Core SDKS installed in my laptopenter image description here

The command dotnet --info gave me the following details

enter image description here

I created a Azure function with V3 template

enter image description here

The project settings are given below

When I try to debug , i get the following error

A fatal error has occurred and debugging needs to be terminated. The debugger was configured to use the Desktop CLR (.NETFramework) Managed debugger, but the target process loaded the CoreCLR (.Net Core) runtime. To debug this project, configure it to use the 'Managed (CoreCLR)' debugger."

enter image description here Tried several options like the one mentioned in the link below

https://social.msdn.microsoft.com/Forums/en-US/59f880f7-ed60-4842-bc55-a9400971c58b/problem-debugging-net-core?forum=vsdebug

like image 953
Sabarish Sathasivan Avatar asked Feb 04 '20 04:02

Sabarish Sathasivan


2 Answers

EDIT: This has been fixed in the latest release of Visual Studio v16.4.5


The problem seems to be a mismatch in the version of the Azure Functions CLI. As a workaround, you can do this:

  1. Install the latest Azure Functions CLI, from the command line run:

    npm i -g azure-functions-core-tools@3 --unsafe-perm true
    

    or if you are using Chocolatey:

    choco install azure-functions-core-tools
    
  2. Restart Visual Studio.

like image 123
DavidG Avatar answered Sep 28 '22 09:09

DavidG


I still have this issue after reinstalling my VS2019, downloading the latest sdk and downloading the core tools multiple times. Seems like the only way for now is to run without using the debugger (Ctrl + F5). Sometimes I downgrade the function to v2.1 for this only happens on v3 functions.

Edit: I got this fixed when I updated my VS to 16.5.1

like image 44
Raffy Avatar answered Sep 28 '22 09:09

Raffy