Can't launch dotnet-watch configuration in debug mode asp.net core 6 mac m1 Rider

944 Views Asked by At

On start up, it writes Cannot open assembly '/usr/local/share/dotnet/dotnet': File does not contain a valid CIL image..

I have two versions of platform installed: .net 6 and .net core 3.1. This is my launchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:23641",
      "sslPort": 44387
    }
  },
  "profiles": {
    "Web": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "applicationUrl": "https://localhost:7047;http://localhost:5148",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Watch": {
      "commandName": "Executable",
      "executablePath": "dotnet",
      "workingDirectory": "$(ProjectDir)",
      "commandLineArgs": "watch run"
    }
  }
}

Both modes work great with Web configuration. But it requires me to restart it on many changes. .NET 6 hot reload is enabled by default.

1

There are 1 best solutions below

1
On BEST ANSWER

I didn't understand exactly what was wrong. I fixed this by uninstalling all .NETs and reinstalling it one by one, with checking the ability to debug. I guess that the problem was with that I firstly installed Core 3 which was for x64 architecture and after arm64 .NET 6. Or, maybe, it was the problem with the .NET 6 specific version, as it was the first version.