I can run dotnet watch and I can Run my ASP.NET core application, but if I try debugging, I get the error message below. I have .NET 7 sdk installed (otherwise dotnet watch and Run in my app wouldn't work either)
/home/timmy/Repos/myaspnetapp/src/Application/bin/Debug/net7.0/Application
You must install or update .NET to run this application.
App: /home/timmy/Repos/myaspnetapp/src/Application/bin/Debug/net7.0/BlazorDebugProxy/BrowserDebugHost.dll
Architecture: x64
Framework: 'Microsoft.AspNetCore.App', version '7.0.0-preview.5.22303.8' (x64)
.NET location: /usr/lib/dotnet/dotnet6-6.0.108/
The following frameworks were found:
6.0.8 at [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
More info
- I am running this on Ubuntu 22.04 and Rider 2022.2.1, but it seems VS Code has the same issue so I think it's a dotnet issue.
- I have dotnet6 installed in
/usr/lib/dotnet, subfolderdotnet6-6.0.108 - I've had dotnet7 in multiple different folders to see if that would make any difference
- In Rider the
Toolset and Buildpath for.NET CLI executable pathis/usr/lib/dotnet/dotnet7-7.0.100/dotnetand the MSBuild path is that same folder butsdksubdirectory
It's worth noting that debugging a .NET 7 console project works fine, but not ASP.NET core.
I may uninstall .NET 6 to see if that would help but my hopes are a bit low after wasting hours trying to get this to work. Any help would be appreciated.