iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
👋

C# Development Notes on macOS Big Sur and VSCode

に公開

VSCode Settings

I've installed at least this plugin for now.
C# - Visual Studio Marketplace

{
  "[csharp]": {
    "editor.defaultFormatter": "ms-dotnettools.csharp"
  },
  "omnisharp.useEditorFormattingSettings": true,
  "csharp.format.enable": true
}

Type completion and formatting will now be available.

Cloud Function Development

Your first function: .NET | Google Cloud Functions Documentation

I followed the instructions provided there.

It didn't work with only .NET 5.0, resulting in the following error:

It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found.
  - The following frameworks were found:
      5.0.8 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
The .NET 3.1.40x SDKs require version 16.7 of MSBuild.

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=x64&rid=osx.11.0-x64

(It was actually mentioned in the GCP documentation,) but it worked after I found and installed the .NET Core 3.1 SDK from the link.

Additional VSCode Settings

C# - Visual Studio Marketplace

As mentioned in the Note about using .NET Core 3.1.40x SDKs at the link, set useGlobalMono to never.

{
  "omnisharp.useGlobalMono": "never"
}
GitHubで編集を提案

Discussion