VSCode的omnisharp找不到net framework的问题,解决

[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\Users\Downloads\Asn1Editor.WPF-master\Asn1Editor.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\Downloads\Asn1Editor.WPF-master\Asn1Editor\Asn1Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Users\Downloads\Asn1Editor.WPF-master'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\Users\Downloads\Asn1Editor.WPF-master' on host 7668.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\Downloads\Asn1Editor.WPF-master\Asn1Editor\Asn1Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for .NETFramework,Version=v4.5 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\Downloads\Asn1Editor.WPF-master\Asn1Editor\Asn1Editor.csproj'.
c:\Users\Downloads\Asn1Editor.WPF-master\Asn1Editor\Asn1Editor.csproj
c:\Users\.vscode\extensions\ms-dotnettools.csharp-1.23.12\.omnisharp\1.37.10\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1216,5): Error: The reference assemblies for .NETFramework,Version=v4.5 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\Downloads\Asn1Editor.WPF-master\Asn1Editor\Asn1Editor.csproj

使用omnisharp时出现了.netframework找不到的情况

环境是win10,已经默认安装了4.8的netframework,很奇怪为何cannot found这个系统安装的最新的framework呢?

具体报错如上面显示。去它指示的路径看c:\Users\.vscode\extensions\ms-dotnettools.csharp-1.23.12\.omnisharp\1.37.10\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1216,5),看不懂。

怀疑最终问题是没有找到framework的路径,于是重新下载安装一个新的,当然网上有说win10因为已经安装了一个,版本低的安装不上,可以安装开发版本,试了一下,安装可以,但是路径设置到系统环境变量path之后,还是不行。

索性安装最新版本的


​可以看到它自动更新了系统变量,这个就是希望vscode能找到,最后在完成升级了vscode之后(有一篇文章介绍怎么最终实现win10的vscode更新,就是拷贝更新文件的问题),再重新安装了最新的.net SDK之后,重新启动之后,可以看到能执行dotnet --info了,也就是对vscode和omnisharp能找到它了,这样,对应的.csproj打不开的问题就不报了,是一个问题。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

芯片-嵌入式

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值