一怒之下我恢复了电脑的出厂设置,重新配置一遍后还是报错,
Could not locate MSBuild instance to register with OmniSharp.
The .NET Core SDK cannot be located.
The .NET Core SDK cannot be located: A valid dotnet installation could not be found. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.
反正就是VSCode的omnisharp找不到net framework的问题
最后不知道怎么稀里糊涂就解决了,最后解决时的状态是这样的:
.net 下载的是最新的7.0,但是我忘了是用户版还是开发者版了,我猜是开发者版
.net下载
插件被我杀的还剩这几个:
控制台写dotnet --info输出的是这样的
C:\Users\user马赛克>dotnet --info .NET SDK: Version: 7.0.102 Commit:
4bbdd14480运行时环境: OS Name: Windows OS Version: 10.0.19044 OS Platform:
Windows RID: win10-x64 Base Path: C:\Program
Files\dotnet\sdk\7.0.102\Host: Version: 7.0.2 Architecture: x64 Commit:
d037e070eb.NET SDKs installed:
7.0.102 [C:\Program Files\dotnet\sdk].NET runtimes installed: Microsoft.AspNetCore.App 7.0.2 [C:\Program
Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App
7.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 7.0.2 [C:\Program
Files\dotnet\shared\Microsoft.WindowsDesktop.App]Other architectures found: None
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download
vscode的setting.json里被我删光了,一个字没有:
也就是说
omnisharp:path写的""(空),
omnisharp : use modern net 写的true
omnisharp : dotnet path 是空
omnisharp : sdk path 还是空
.omnisharp文件夹里有两个版本,也不知道哪个是正确的,我猜测是第二个1.39.2-net6.0
还下载了一个framework4.7.1,不知道有没有起到关键作用。我猜是有的,解决了vscode它向我要framework4.7.1的问题
最后成果是这样的:
总结:framework4.7.1,.net7.0,omnisharp设置全默认
搬家至博客园
var code = "fe4d2a76-afac-4c09-8fa4-278831f70403"
版权归原作者 喵喵是个小程序员 所有, 如有侵权,请联系我们删除。