How to fix local debugging of Azure Functions in Visual Studio for Mac

Visual Studio 8.8.4 fixes BigSur CLR error

UPDATED — 14th January 2021

The bug has now been closed as fixed by Visual Studio — please ensure you have the latest version installed.

UPDATED — installed Big Sur? First ensure that you have updated Visual Studio to version 8.8 release 4 (Wednesday 16th December 2020).

This will resolve an issue where the terminal doesn’t display the Azure function output, instead you would have been greeted with a CLR error.

The rest of this blog covers how I could get Visual Studio working by rolling back the version of Xcode (this worked before I upgraded to BigSur).

Today I tried to run my Visual Studio Azure Function on a Mac, but instead of the terminal showing the Azure function output it displayed nothing.

A very unexciting terminal screenshot

The root cause appears to be related to this bug https://github.com/dotnet/runtime/pull/42900

Oddly Xcode 12 and .NET 5 don’t play well together. The following issue was raised https://github.com/dotnet/runtime/issues/42311 and this comment from c-lamon solved the terminal issue for me.

The solution that worked for me!

I don’t quite understand how Visual Studio for Mac, .NET 5 and Xcode are dependent on each other, but the action of reverting to Xcode 11 does work 🥳

In summary download XCode 11.7 from Apple, rename it (so you can keep Xcode 12.x running too) and move the renamed file to your Applications folder and then tell the operating system which version of XCode should be used.

sudo xcode-select -s /Applications/Xcode_11.app ← To fix Visual Studio on Mac

or

sudo xcode-select -s /Applications/Xcode.app ← Use the latest XCode

Xcode-select controls the location of the developer directory used by xcrun, xcodebuild, cc and other Xcode and BSD development tools.

xcode-select man page extract

And voila — Azure functions are now successfully running locally on the Mac through the Visual Studio debugger.

My only disappointment was that the terminal didn’t render the Microsoft Azure Functions ASCII art 😏

Azure Functions Logo — not included

Follow me on Twitter - https://twitter.com/codingrob

--

--

--

I am a technical writer, weekly topics include Java, C#, AWS, Azure, Mongo. On my learning journey of new topics I will share them with you on Medium

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Cracking the “Impact Mapping” code for a winning product strategy

Introduction to GIT Basics — Part One

Linux under the Hood — Memory Management

Elasticsearch meets BERT: Building Search Engine with Elasticsearch and BERT

Best practices for CI/CD pipeline

Win 11 Task Barf

Internship Experience at Oasis Infobyte (https://oasisinfobyte.in/)

Impact of IoT On The Web Development From A Future Perspective

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rob Wilson

Rob Wilson

I am a technical writer, weekly topics include Java, C#, AWS, Azure, Mongo. On my learning journey of new topics I will share them with you on Medium

More from Medium

Azure AD B2C for .NET 4.8: Old Dogs Can Learn New Tricks

How to Implement Microsoft.Identity.Web in Azure Functions V4 and .NET 6

Working with Azure SDK for .NET

In-depth implementation of Azure Service Bus with C# and .NET