[英]Error: The reference assemblies for .NETFramework,Version=v5.0 were not found
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. 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"
设置“omnisharp:select 项目 > 我当前的项目”重新安装.Net SDK 5,更改omnisharp 路径,将“使用全局单声道”属性更改为“始终”
I have left Output screen below, you to more understand:我在下面留下了 Output 屏幕,您更了解:
[fail]: OmniSharp.MSBuild.ProjectLoader The reference assemblies for .NETFramework,Version=v5.0 were not found.
[失败]:OmniSharp.MSBuild.ProjectLoader .NETFramework,Version=v5.0 的参考程序集未找到。 To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application.
要解决此问题,请为此框架版本安装开发包(SDK/Targeting Pack)或重新定位您的应用程序。 You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
您可以在https://aka.ms/msbuild/developerpacks下载 .NET 框架开发人员包
[warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\Users\ilyas\Desktop.Net Notes.Net 5 and C# 9\Basics\Basics.csproj'.
[警告]:OmniSharp.MSBuild.ProjectManager 无法加载项目文件“c:\Users\ilyas\Desktop.Net Notes.Net 5 和 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.
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):错误:未找到 .NETFramework、Version=v5.0 的参考程序集。 To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application.
要解决此问题,请为此框架版本安装开发包(SDK/Targeting Pack)或重新定位您的应用程序。 You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
您可以在https://aka.ms/msbuild/developerpacks下载 .NET 框架开发人员包
[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
[失败]:OmniSharp.MSBuild.ProjectManager 尝试更新未加载的项目:c:\Users\ilyas\Desktop.Net Notes.Net 5 和 ZD7EFA19FBE7D3972FDcsZproj6024
PS I am new to english, sorry for grammar rules PS我是英语新手,语法规则很抱歉
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".
我已经安装了目标框架,但是“vs code”试图获取“VS 2019 社区中的.net 5 sdk”。 I've upgraded VS 2019 community, which solved my problem.
我升级了 VS 2019 社区,解决了我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.