Reputation: 968
I've installed VS code to build simple examples while I learn .net 5 and c# 9. But VS code doesn't recognize .net sdk 5. I can create new console projects as net 5.
however I don't use properties like these; viewing problems in problems section right click > peek definition
I've searched solution for this on the net and I did things below; setting "omnisharp: select project > my current project" reinstalling .Net SDK 5, changing omnisharp path, changing "use global mono" property as "always"
I have left Output screen below, you to more understand:
[fail]: OmniSharp.MSBuild.ProjectLoader The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\Users\ilyas\Desktop.Net Notes.Net 5 and C# 9\Basics\Basics.csproj'. c:\Users\ilyas\Desktop.Net Notes.Net 5 and C# 9\Basics\Basics.csproj C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): Error: The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[fail]: OmniSharp.MSBuild.ProjectManager Attempted to update project that is not loaded: c:\Users\ilyas\Desktop.Net Notes.Net 5 and C# 9\Basics\Basics.csproj
P.S. I am new to english, sorry for grammar rules
Upvotes: 1
Views: 4757
Reputation: 968
Finally I figured out why I get this error. I've installed targeting framework, however "vs code" tries to get ".net 5 sdk which is within VS 2019 community". I've upgraded VS 2019 community, which solved my problem.
Upvotes: 3