.net 安装了DotnetFramework运行时和SDK,但VS2022和Win10无法识别它们

vuv7lop3  于 2022-12-05  发布在  .NET
关注(0)|答案(2)|浏览(707)

Found either a bug in windows 10 or a bug in VS2022 or both whereby the DotNetFramework Dev tools and runtimes are installed, yet they do not show up from the command line prompt nor in Programs & Features. Attempting to reinstall any of them (4.52, 4.62, 4.72, 4.82) yields an error message stating they are already installed. Like Schroedinger's Cat, they are both installed and uninstalled simultaneously.
C:\WINDOWS\system32>dotnet --info .NET SDK: Version: 7.0.100 Commit: e12b7af219
Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win10-x64 Base Path: D:\Program Files\dotnet\sdk\7.0.100
Host (useful for support): Version: 6.0.5 Commit: 70ae3df4a6
.NET SDKs installed: 3.1.425 [D:\Program Files\dotnet\sdk] 5.0.203 [C:\Program Files\dotnet\sdk] 5.0.214 [D:\Program Files\dotnet\sdk] 5.0.401 [C:\Program Files\dotnet\sdk] 5.0.403 [C:\Program Files\dotnet\sdk] 5.0.408 [C:\Program Files\dotnet\sdk] 6.0.202 [C:\Program Files\dotnet\sdk] 6.0.403 [D:\Program Files\dotnet\sdk] 7.0.100 [D:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.31 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.31 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.31 [D:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [D:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

微软. Windows桌面.应用程序6.0.4 [C:\程序文件\dotnet\共享\微软. Windows桌面.应用程序]
微软. Windows桌面.应用程序6.0.5 [C:\程序文件\dotnet\共享\微软. Windows桌面.应用程序]
微软. windows 桌面.应用程序6.0.11 [D:\程序文件.网络\共享\微软. windows 桌面.应用程序]
微软. Windows桌面.应用程序7.0.0 [D:\程序文件\dotnet\共享\微软. Windows桌面.应用程序]
要安装其他.NET运行时或SDK,请执行以下操作:
https://aka.ms/dotnet-download
仅显示DotNet Core SDK和运行时,而不显示任何旧的DotNetFrameworks(任何版本),即使已安装它们。
我不知所措,准备把这台机器吹走,完全从头开始,但是,我宁愿不这样做。有什么想法吗?(我试过微软的“修复dotnet”工具,但没有任何效果)
看起来VS 2022是损坏后,他们的最新更新-我试图修复安装,并得到“对不起,出错了”无法修复Microsoft.Net.4.8.FullRedist.20H2
有一个选项可以向MS报告问题,所以我做了。
我仍然相信这是一个路径问题(VS 2022被安装在D:\驱动器上,VS 2019-几个月前已经被删除-被安装在C:\驱动器上),所以我可能要卸载VS 2022并重新安装到c:\驱动器回来。

euoag5mw

euoag5mw1#

dotnet工具只适用于与.“NET”(或以前的.“NET核心”)相关的内容,它不适用于.“NET框架”。.“NET框架”是一个Windows组件,你不能不安装它。
至于Visual Studio,根据您创建的项目类型,它可能是用于.NET Framework的,也可能是用于.NET的,但不能同时用于这两种类型-除非您手动编辑项目文件。请参见here作为不同项目类型的示例。
如果你仍然有问题,张贴进一步的细节,你具体试图完成将有所帮助。

7ajki6be

7ajki6be2#

不是真正的答案,但一个临时的解决方案。我尝试了一切在阳光下让VS2022利用DotNetFramework〉ver 3.5没有喜悦,所以我重新安装了VS2019,并有所有正确的框架选择。我只会使用VS2019为旧的应用程序从现在开始。重新安装VS2022(完全卸载后)仍然只给我留下了2.0、3.0和3.5版,所以我认为最新的VS2022有一个bug。

相关问题